1
0
Fork 0
Commit graph

690 commits

Author SHA1 Message Date
Owen W. Taylor
19d1f97600 Use G_GNUC_UNUSED to suppress warning
On gcc-4.4 (void)<expr> doesn't suppress warnings from
__attribute__((warn_unused_result)), so use
G_GNUC_UNUSED (which expands to __attribute__((unused))) instead
of removing a dummy variable.

https://bugzilla.gnome.org/show_bug.cgi?id=640508
2011-01-25 08:39:20 -05:00
Owen W. Taylor
4f079affea Fix set but not used variables
GCC 4.6 warns about variables that are set but never subsequently
used; fix all such instances.

https://bugzilla.gnome.org/show_bug.cgi?id=640469
2011-01-24 16:26:57 -05:00
Jasper St. Pierre
b4888103a6 display: Don't crash on Alt-Escape.
Fix a crash caused by 286160646b, where
we don't get a window when called from do_choose_window.

https://bugzilla.gnome.org/show_bug.cgi?id=640229
2011-01-24 19:38:55 +01:00
Florian Müllner
2eb8b09b1a Restore the original tile state when a drag is cancelled
If a drag operation is cancelled, the dragged window should be
restored to its previous state/position. Implement this for tiled
states.

https://bugzilla.gnome.org/show_bug.cgi?id=639988
2011-01-20 18:49:48 +01:00
Florian Müllner
bca610ed50 Hide tile preview when cancelling a drag with Escape
As the tile preview is shown or hidden when a window is dragged
around, it may stick around if the drag operation is cancelled.
Make sure that the preview is hidden in this case.

https://bugzilla.gnome.org/show_bug.cgi?id=639988
2011-01-20 18:49:48 +01:00
Florian Müllner
53d6938b55 screen: Add a method to hide the tile preview unconditionally
Add meta_screen_tile_preview_hide() to hide the tile preview
independent from the tile state of the dragged window.

https://bugzilla.gnome.org/show_bug.cgi?id=639988
2011-01-20 18:49:48 +01:00
Florian Müllner
286160646b display: Keep track of the original tile state during drag
Drag operations may be cancelled, in which case the dragged window
should be restored to the position/state it had when the drag was
initialized. In order to do this for tiled states, the original
state has to be saved during the operation.

https://bugzilla.gnome.org/show_bug.cgi?id=639988
2011-01-20 18:49:48 +01:00
Florian Müllner
58068260a5 window: Make meta_window_tile() semi-public
The previous tiling state of a grabbed window should be restored
if the drag operation is cancelled (by hitting the Escape key).
This might involve to meta_window_tile(), so export the function
in window-private.h.

https://bugzilla.gnome.org/show_bug.cgi?id=639988
2011-01-20 18:49:48 +01:00
Rui Matos
bbfc435a5c Teach meta_display_get_keybinding_action() about "Above_Tab" pseudo-keysym
https://bugzilla.gnome.org/show_bug.cgi?id=639532
2011-01-16 13:55:41 -05:00
Owen W. Taylor
4ea00e102b Add an "Above_Tab" pseudo-keysym
We want switching between the windows of an application to be an easily
accessible operation. The convenient and memorable keybinding is the
key above the tab key - but the keysym for that key isn't consistent
across different keyboard layouts.

Add code that figures out the key from the XKB geometry and a magic
keysym name "Above_Tab" that refers to this key and switch
the default binding for cycle_group to <Alt>Above_Tab. (This will
have no effect for the normal case of getting the key binding from
GConf until this patch is applied to Metacity as well.)

https://bugzilla.gnome.org/show_bug.cgi?id=635569
2011-01-05 18:58:11 -05:00
Florian Müllner
ed99d12e8b theme: Add tiled_left/tiled_right frame states
It may be desirable for theme authors to treat side-by-side tiled
windows differently, for instance to give the edge-touching border
a width of 0, so add additional frame states for tiled windows.

https://bugzilla.gnome.org/show_bug.cgi?id=637330
2011-01-05 01:49:58 +01:00
Nickolas Lloyd
48b9807c86 Remove option to turn compositing off
This patch removes the ability to disable compositing in mutter.  As
clutter compositing was the reason for the fork from metacity, turning
compositing off does not make sense.

https://bugzilla.gnome.org/show_bug.cgi?id=626875
2011-01-04 11:55:05 -05:00
Owen W. Taylor
0a821d2341 Update window->visible_to_compositor before calling into compositor
To deal with reentrancy from compositor plugins doing things like
moving windows between workspaces in an effect callback, update
the visible_to_compositor flag before calling into the compositor.

https://bugzilla.gnome.org/show_bug.cgi?id=613124
2011-01-04 11:46:44 -05:00
Owen W. Taylor
78092a404f If enabling a compositor with existing windows, set them visible as necessary
When a compositor is present, we keep the visibility state of the
compositor windows in sync with window->visible_to_compositor. We need
to do the same when enabling the compositor.

https://bugzilla.gnome.org/show_bug.cgi?id=613124
2011-01-04 11:40:41 -05:00
Florian Müllner
594a69317a tiling: Reset maximized tile mode when unmaximizing
Maximized tiled windows end up with an inconsistent tile mode when
unmaximized by other means than dragging the window free (e.g.
using the unmaximize button or double clicking the title bar), so
reset the tile mode when unmaximizing.

This is not a problem for side-by-side tiling, as there are no
alternatives to dragging the window free.
2010-12-10 17:30:18 +01:00
Florian Müllner
654bd15319 tiling: Do not restore maximized tile state when unmaximizing
When a tiled window is maximized (e.g. by clicking the title bar
button), unmaximizing the window restores the tiled state. While
this is reasonable for side-by-side tiling, it is confusing for
"maximize" tiled windows, as unmaximization has no visible effect.

Change unmaximize to only restore the tiled state of side-by-side
tiled windows.
2010-12-04 21:35:15 +01:00
Florian Müllner
b85171007e window: Add a missing break
When adding maximize tiling, the cleaning of the tiled flag was
refactored to use a switch statement - a break was missed in the
process.
2010-12-04 21:35:15 +01:00
Florian Müllner
7d0ff87cbe tiling: Fix "maximize" tile with no chrome at the top
The original patch triggered "maximize" when the window was dragged
to the top, so that the pointer was below or on the monitor edge and
above the work area's top.

If there's no chrome at the top of the monitor, so that monitor edge
and work area top fall together, the pointer cannot be moved above
the work area's top, so tiling was not triggered.
2010-12-03 02:45:41 +01:00
Florian Müllner
161c1088f9 tiling: disable "shake loose" feature when edge tiling
The old behavior of being able to shake loose a maximized window
overlaps with and is for the most part superceded by top edge tiling.

This commit changes the code to only enable shake loose behavior
when edge tiling is disabled.

https://bugzilla.gnome.org/show_bug.cgi?id=630548
2010-12-02 17:42:14 -05:00
Ray Strode
07c0471902 tiling: Add new "maximized" tile
In addition to the existing side-by-side tiling modes, this commit
adds a new "maximize" tiling mode.  It allows the user to maximize
their windows (in other words, tile with the edge panels) by dragging
their window to the top edge of the monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=630548
2010-12-02 17:11:11 -05:00
Ray Strode
5f4ee1b6e7 tiling: use META_WINDOW_TILED_SIDE_BY_SIDE in state check
The meta_window_handle_mouse_grab_op_event function ensures
the tile_mode variable is in a consistent state after a drag
op is finished.

The way this is current done is:

if (!window->maximized_vertically &&
    window->tile_mode != META_TILE_NONE)
  window->tile_mode = META_TILE_NONE;

While valid, it doesn't "read" as well as using the
META_WINDOW_TILED_SIDE_BY_SIDE macro, since the macro is specifically
about side-by-side tiling.

This commit just changes things to use the macro and to not bother
checking the tile mode (since if we just reset it anyway, then it doesn't
matter if the value is right or wrong to begin with).

https://bugzilla.gnome.org/show_bug.cgi?id=630548
2010-12-02 16:35:23 -05:00
Ray Strode
aa3a4a48e4 tiling: add side_by_side suffix to tile code
The meta_window_can_tile function and META_WINDOW_TILED
macro are pretty side-by-side tiling specific, so
rename them.

https://bugzilla.gnome.org/show_bug.cgi?id=630548
2010-12-02 16:35:23 -05:00
Ray Strode
0d27c9600f tiling: rename side-by-side tiling to edge tiling
Currently, the new tiling feature, supports side-by-side, horizontal
tiling when dragging windows to one of the vertical edges of a monitor.

Other types of tiling (on other monitor edges) are potentially useful,
though.

This commit renames the preference from side_by_side_tiling to
edge_tiling.

https://bugzilla.gnome.org/show_bug.cgi?id=630548
2010-12-02 16:35:23 -05:00
Milan Bouchet-Valat
1986b20499 Add (out) annotation and documentation to meta_window_get_outer_rectangle()
GObject introspection cannot detect that rect is an (out) parameter.
Also add a meaningful documentation for humans like us.
2010-12-02 00:06:42 +01:00
Florian Müllner
6b98644c58 workspace: Consider text direction when switching
A direction parameter is passed to meta_compositor_switch_workspace(),
to indicate the direction of the switch depending on the workspace
layout.
In contrast to the switcher popup, this parameter does not take the
text direction of the locale into account. Change this, so that the
workspace switching animations move in the correct direction.

https://bugzilla.gnome.org/show_bug.cgi?id=636083
2010-11-29 21:42:58 +01:00
Owen W. Taylor
b031543f5a Fix updating overlay key keycode when keymap changes
overlay_key_combo needs the same treatment as other keycodes on a
change - we should always recompute it if we have a keysym not
a keycode, and not only if the keycode hasn't already been
computed.
2010-11-22 16:10:34 -05:00
Owen W. Taylor
c6be05f9d7 Unify keymap-reloading code branches
Simplify the keymap loading logic by unifying the different
branches; in the reorganization this patch fixes a bug where when
we got a MappingKeyboard event we wouldn't update virtual modifiers
correctly.

Based on a patch by Thomas Thurman <tthurman@gnome.org>

https://bugzilla.gnome.org/show_bug.cgi?id=565540
2010-11-22 16:02:03 -05:00
Derek Poon
cb88e0d052 Update keybindings when XKB keyboard layout changes
* Select for XKB keyboard notification events explicitly; since GTK+
  has selected for XKB events, delivery of old-school MappingNotify
  events is disabled.

* Fix a bug where once a keycode was loaded for a key binding,
  it would never be reassigned; we want to laod new keycodes for
  all bindings that have a key symbol rather than a fixed
  keycode.

[ With fixes from Owen W. Taylor <otaylor@fishsoup.net> ]

https://bugzilla.gnome.org/show_bug.cgi?id=565540
2010-11-22 16:02:03 -05:00
Owen W. Taylor
f372fa29b2 MetaStackTracker: Avoid queueing resync for obvious no-ops
Since we can't distinguish a ConfigureEvent that indicates a raise
from a ConfigureEvent that indicates a move, we get lots of
STACK_OP_RAISE_ABOVE events for windows that are already in the
right place in the stacking order. Avoid queueing a restack in that
case.

https://bugzilla.gnome.org/show_bug.cgi?id=634771
2010-11-18 09:54:44 -05:00
Owen W. Taylor
d4c28fc5f5 Add meta_window_get_maximized() and meta_window_is_fullscreen()
These functions duplicate existing properties; they are added for
convenience and to avoid the GObject property code on some
performance critical painting paths.

https://bugzilla.gnome.org/show_bug.cgi?id=592382
2010-11-18 09:47:58 -05:00
Owen W. Taylor
52aebdf223 Add meta_window_get_frame_type()
Add a public function to get the frame type for a window; the
code is refactored from existing code in core.c.

https://bugzilla.gnome.org/show_bug.cgi?id=592382
2010-11-18 09:47:57 -05:00
Owen W. Taylor
6b16604c26 Export meta_window_appears_focused()
Move meta_window_appears_focused() into the public window.h so
we can use it to change the shadow type.

https://bugzilla.gnome.org/show_bug.cgi?id=592382
2010-11-18 09:47:57 -05:00
Owen W. Taylor
ed2fbcd13a Add frame type for attached modal dialogs
Add a new frame type META_FRAME_TYPE_ATTACHED which is used for
attached modal dialogs.

The theme format version is bumped to 3.2, and attached windows
can have borders defined in a metacity-theme-3.xml as:

 <window version=">= 3.2" type="attached" style_set="[name]"/>

If no style is defined for "attached", drawing will fall back
to the "border" type.

https://bugzilla.gnome.org/show_bug.cgi?id=592382
2010-11-18 09:47:57 -05:00
Owen W. Taylor
441c050808 Fix check for events on UI widgets
Now that we create MetaWindow objects for override-redirect windows, we need
to check all key press events to see if they are on GTK+ widgets, not just
events that don't match a MetaWindow. This fixes a problem with alt-Tab stealing
grabs away from the window menu.

https://bugzilla.gnome.org/show_bug.cgi?id=633398
2010-10-28 16:33:28 -04:00
Florian Müllner
b445ee3763 Remove compatibility for GTK+-2.0
While the Meego developers agreed to switching mutter to GTK+-3.0
unconditionally a while ago, Canonical used a GTK+-2.0 build for their
Unity project. As Canonical now announced a switch to compiz as their
window manager, there is no longer a reason to maintain GTK+-2.0
compatibility.

https://bugzilla.gnome.org/show_bug.cgi?id=633133
2010-10-28 12:16:14 +02:00
Dan Winship
03578b69f3 meta_display_get_keybinding_action: remove keysym parameter
meta_display_process_key_event() always looks up events based on the
"default" keysym for the keycode, so we should do the same here. This
fixes, eg, the lookup of Shift-Alt-Tab (which would otherwise be
unrecognized because the keysym would be XK_ISO_Left_Tab rather than
XK_Tab).

https://bugzilla.gnome.org/show_bug.cgi?id=632155
2010-10-25 16:37:52 -04:00
Owen W. Taylor
52bc675fcb introspection: remove --allow-unprefixed
Remove --allow-unprefixed option to the scanner, and fix resulting
problems:

 * theme.h and boxes.h are split into a main -header and a private
   header that includes stuff that is not generally useful and
   hard to introspect. Merge theme-parser.h into theme.h.

 * meta_display_get_atom() and meta_window_get_window_type_atom()
   are marked as (skip)

 * Fix annotation: (element-type Strut) => (element-type Meta.Strut)

https://bugzilla.gnome.org/show_bug.cgi?id=632494
2010-10-23 15:58:16 -04:00
Owen W. Taylor
1920f211b0 Remove Mutter namespace prefix
Move all objects and functions namespaced with Mutter into the Meta namespace
to get a single consistent namespace. Changes that aren't simply changing mutter
to meta:

 MutterWindow              => MetaWindowActor
 mutter_get_windows        => meta_get_window_actors
 mutter_plugin_get_windows => meta_plugin_get_window_actors

https://bugzilla.gnome.org/show_bug.cgi?id=628520
2010-10-23 15:48:29 -04:00
Owen W. Taylor
804117c456 Remove MetaRegion
In many places, MetaRegion was being used entirely internally, rather
than for gtk2/gtk3 compatibility. In these cases, it's simpler to just
depend on cairo-1.10 (for both gtk2 and gtk3) and use cairo_region_t.

The few places where we did need GDK compatibility (GdkEvent.region and
gdk_window_shape_combine_mask) are replaced with a combination of
converting GdkRegion to cairo_region_t and conditional code.

https://bugzilla.gnome.org/show_bug.cgi?id=632474
2010-10-23 15:48:29 -04:00
Dan Winship
9a4d1686a6 Fill in missing MetaKeyBindingAction values
Also, add an assertion to init_bindings() to keep it from getting out
of sync again in the future.

https://bugzilla.gnome.org/show_bug.cgi?id=632149
2010-10-20 14:00:06 -04:00
Benjamin Otte
33489c8cb8 Adapt to GTK API changes
This code adapts mutter to the latest changes to GTK in
http://git.gnome.org/browse/gtk+/commit/?id=872ef111ecabf6cd4453590b1e17afd3c9757f28
that remove the dest argument from gdk_pixbuf_get_from_window() and
gdk_pixbuf_get_from_surface().

It also removes the dest argument from meta_gdk_pixbuf_get_from_pixmap()
to match. The function is internal and the argument wasn't used.

https://bugzilla.gnome.org/show_bug.cgi?id=631147
2010-10-02 04:27:05 +02:00
Florian Müllner
a2e4789b3e tiling: Limit tiling to landscape orientation
Tiling is arguably only useful for monitors in landscape orientation,
so disable it when the current monitor is in portrait orientation.
2010-09-24 17:46:57 +02:00
Owen W. Taylor
7d58524185 Fix use of (closure) annotation
For functions (but not callback types), '(closure)' is used on the
callback parameter, and takes the name of the parameter which is
the closure/user data.
2010-09-24 11:28:26 -04:00
Florian Müllner
635e20d057 Allow breaking out from tiling during a mouse resize
Extend the code which allows resizing maximized windows using
alt-middle-drag, so that it applies to tiled windows as well.

https://bugzilla.gnome.org/show_bug.cgi?id=629931
2010-09-23 13:32:35 +02:00
Owen W. Taylor
1c3f7c4088 Allow breaking out from maximization during a mouse resize
A maximized window can't be resized from the screen edges (preserves
Fitts law goodness for the application), but it's still possible
to start a resize drag with alt-middle-button. Currently we just
don't let the user resize the window, while showing drag feedback;
it's more useful to let the user "break" out from the resize.

This provides a fast way to get a window partially aligned with
the screen edges - maximize, then alt-drag it out from one edge.

Behavior choices in this patch:

 - You can drag out a window out of maximization in both directions -
   smaller and larger. This can be potentilaly useful in multihead.

 - Dragging a window in only one direction unmaximizes the window
   fully, rather than leaving it in a horizontally/vertically
   maximized state. This is done because the horizontally/vertically
   maximzed states don't have clear visual representation and can
   be confusing to the user.

 - If you drag back to the maximized state after breaking out,
   maximization is restored, but you can't maximize a window by
   dragging to the full size if it didn't start out that way.

A new internal function meta_window_unmaximize_with_gravity() is
added for implementing this; it's a hybrid of
meta_window_unmaximize() and meta_window_resize_with_gravity().

Port of the metacity patch from Owen Taylor in bug 622517.

https://bugzilla.gnome.org/show_bug.cgi?id=629931
2010-09-23 13:32:35 +02:00
Owen W. Taylor
c2f894963a Use GDK error trapping straight-up
The hacks we were playing by calling gdk_error_trap_push() and then
resetting the error handler are incompatible with the rewrite of
GDK error traps.

Since the new error code has some features that simplify what we
are doing (like automatically figuring out whether a XSync() is needed)
and because our custom error handler didn't have a lot of a point,
use a separate code path for GTK+ 3.0 builds that just uses the
GDK error traps straight-up without a custom error handler.

https://bugzilla.gnome.org/show_bug.cgi?id=630195
2010-09-20 18:41:21 -04:00
Nickolas Lloyd
dacea8edf9 Fix behavior of the window resize popup to only appear when resizing
This patch reverts part of commit 94f6479, which accidentally removed
a section of code and introduced this bug.

https://bugzilla.gnome.org/show_bug.cgi?id=598603
2010-09-20 11:14:45 -04:00
Owen W. Taylor
ed9d7f18a6 Avoid confusion when _NET_WM_USER_TIME_WINDOW is in the window stack
Wine sets _NET_WM_USER_TIME_WINDOW to point to an unmapped toplevel;
this was causing much confusion because both the real window and
the unmapped window were in the window stack and mapped back to the
same MetaWindow.

Debugged by Alban Browaeys
https://bugzilla.gnome.org/show_bug.cgi?id=593887
2010-09-17 14:23:33 -04:00
Florian Müllner
97e2b4666b Implement side-by-side tiling
When dragging a window over a screen edge and dropping it there,
maximize it vertically and scale it horizontally to cover the
corresponding half of the current monitor.

Whenever a "hot area" which triggers this behavior is entered, an
indication of window's target size is displayed after a short delay
to avoid distraction when moving a window between monitors.

https://bugzilla.gnome.org/show_bug.cgi?id=606260
2010-09-17 16:00:03 +02:00
Florian Müllner
ee2f995fc7 introspection: Fix annotations
The scanner got stricter again - some annotations need fixing.
2010-09-15 02:31:47 +02:00
Maxim Ermilov
66105c6e7e Optionally attach modal dialogs
Add a preference /apps/mutter/general/attach_modal_dialogs. When true, instead
of having independent titlebars, modal dialogs appear attached to the titlebar
of the parent window and are moved together with the parent window.
https://bugzilla.gnome.org/show_bug.cgi?id=612726
2010-09-11 05:36:12 +04:00
Maxim Ermilov
bb1ab0afd9 Lower a window and all its transients as a unit
It's strange to leave transients windows around, after ancestor window was
lowered and unfocused.
https://bugzilla.gnome.org/show_bug.cgi?id=612726
2010-09-11 05:36:02 +04:00
Jasper St. Pierre
0d51d9e4cf Remove usage of 'gdk_display', a removed symbol in gtk3.
https://bugzilla.gnome.org/show_bug.cgi?id=629232
2010-09-10 15:18:06 -04:00
Colin Walters
4c0763792d introspection: Build with --warn-fatal, drop fix-meta-rectangle.py hack
Cleanly build with --warn-fatal.  Implementation:

* Liberally apply (skip) where the API is clearly C only, e.g. uses
  XLib.  The theming code and MutterPlugin are skipped too.
* Add missing (transfer) and (element-type) annotations

For a few functions that had a comment, I turned it into gtk-doc, but
I didn't (with a few exceptions) try to write new documentation in
this pass.
2010-09-07 10:48:07 -04:00
Tomas Frydrych
a125b0179a Do not cancel Alt+Tab grab due to modifier key events
If the user just presses a modifier (e.g., shift) during Alt+Tab grab, we need
to keep the grab in place to allow the custom Alt+Tab handler to deal with what
might simply be a change of tabbing direction.

https://bugzilla.gnome.org/show_bug.cgi?id=613126
2010-08-23 10:35:10 +01:00
Nickolas Lloyd
63f81ed027 Fix meta_window_set_user_time: assertion `!window->override_redirect' failed error messages
This patch adds a check in event_callback () to check whether the
window is override-redirect or not, and avoids unnecessarily calling
meta_window_set_user_time () if it is.

https://bugzilla.gnome.org/show_bug.cgi?id=606158
2010-08-18 17:22:01 -04:00
Owen W. Taylor
e590cd2b99 Don't screw up the event mask when "managing" our own windows
When we do pseudo-management on an override-redirect window, we have to be
careful to augment the existing event mask, not replace it, or
delivery of pointer events will be disrupted.

When we unmanage a window, we shouldn't try to unselect events at all,
since that will interfere with event selection done by GDK.

http://bugzilla.gnome.org/show_bug.cgi?id=597763
2010-08-09 12:57:57 -04:00
Andreas Mueller
2b84afc1e3 src/core/util.c: Fix warning in case WITH_VERBOSE_MODE is not set
Signed-off-by: Andreas Mueller <schnitzeltony@gmx.de>

https://bugzilla.gnome.org/show_bug.cgi?id=624166
2010-07-12 11:07:26 -04:00
Owen W. Taylor
11a8ab47fa Make MetaRectangle a boxed type
Export a boxed type for MetaRectangle; this is mostly of interest
because GdkRectangle has been turned into a typedef for
cairo_rectangle_int_t which causes massive problems for using it from
gobject-introspection based language bindings.

https://bugzilla.gnome.org/show_bug.cgi?id=623335
2010-07-02 13:14:39 -04:00
Florian Müllner
7feeb72721 Use cairo_region_t when building with gtk+-3.0
GdkRegion has been removed from Gtk+. The replacement is a
yet-unreleased cairo API, so use it only when building with
Gtk+-3.0.

https://bugzilla.gnome.org/show_bug.cgi?id=587991
2010-07-02 04:36:28 +02:00
Owen W. Taylor
ff5a73de49 Fix problem with window unmaximization
A mismerge of the Metacity commit "4943d79 Prevent window self-maximisation"
caused the window's user set size and position to be saved *before*
actually resizing the window to the unmaximized position rather than after.

This meant that after unmaximization the window was in an inconsistent
state and anything that caused a resize to be queued (like a change in
window properties by the application) would cause it to pop back to
the maximized size and position.

https://bugzilla.gnome.org/show_bug.cgi?id=621413
2010-06-14 16:44:28 -04:00
Colin Walters
604da0f6ea Add _XOPEN_SOURCE display.c for gethostname()
We shouldn't need _GNU_SOURCE in delete.c anymore either.

https://bugzilla.gnome.org/show_bug.cgi?id=620860
2010-06-07 14:26:45 -04:00
Colin Walters
72a19dd448 [display] Include unistd.h for gethostname
https://bugzilla.gnome.org/show_bug.cgi?id=620860
2010-06-07 12:32:56 -04:00
Colin Walters
3a73f6b8ec Add meta_window_is_remote
It's useful for plugins to be able to easily detect whether
or not a window is from a remote host.  Also, make use of this
in the window delete codepath, instead of looking up the hostname
each time.

https://bugzilla.gnome.org/show_bug.cgi?id=620585
2010-06-07 09:44:14 -04:00
Colin Walters
343474a570 Allow logging only specific debug topics
While debugging a focus problem, I noticed that Mutter had exactly
the debug statements I wanted under the META_DEBUG_FOCUS topic.
However, calling meta_set_verbose (true) results in enormous amounts
of other messages, and it's inconvenient to filter after having
started mutter.

This patch allows one to call Meta.add_debug_topic(Meta.DebugTopic.FOCUS)
from a console, and get just what one wants.

https://bugzilla.gnome.org/show_bug.cgi?id=620359
2010-06-04 11:27:48 -04:00
Owen W. Taylor
f45083ce82 Fix crash with --sync option
If the display hasn't been initialized yet, just change the
start variable and don't update the display.

https://bugzilla.gnome.org/show_bug.cgi?id=618613
2010-05-25 13:24:42 -04:00
Tomas Frydrych
e28e7a72aa [MetaDisplay] meta_display_get_leader_window()
This function returns xid of the WM leader window (as defined by the
_NET_SUPPORTING_WM_CHECK mechanism of EWMH). For use by plugins that wish to
attach custom properties to this window.

https://bugzilla.gnome.org/show_bug.cgi?id=613125
2010-05-14 12:44:38 +01:00
Tomas Frydrych
fc9488211f [MetaScreen] Keep num_workspaces key in sync with the actual workspace number
Changing the number of workspaces via an external pager relies on the gconf
key; if a plugin adds or removes workspaces on the fly, we can get into a
situation when the stale number stored by the preferences matches the new
number requested by the pager, in which case the pager request becomes a nop.

This commit ensures that when the meta_screen_append_new_workspace() or
meta_screen_remove_workspace() functions are called, the stored value is
updated accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=613127
2010-05-14 12:31:38 +01:00
Tomas Frydrych
28767c4d34 _MUTTER_HINTS
A per-window _MUTTER_HINTS property allowing plugins to use custom hints. The
property holds a colon separated list of key=value pairs; plugin-specific keys
must be suitably namespaced, while 'mutter-' prefix is reserved for internal
Mutter use only.

This commit adds MetaWindow::mutter-hints property, and
meta_window_get_mutter_hints() accessor, as well as the internal machinery for
reading and updating of the hints.

https://bugzilla.gnome.org/show_bug.cgi?id=613123
2010-05-14 12:20:56 +01:00
Colin Walters
fd20059f68 Add public function to sort windows by stacking
https://bugzilla.gnome.org/show_bug.cgi?id=616050
2010-05-05 17:18:22 -04:00
Colin Walters
609aae684f Export functions to iterate over window transients
https://bugzilla.gnome.org/show_bug.cgi?id=616050
2010-05-05 17:17:41 -04:00
Colin Walters
49940877d1 Export meta_window_raise and meta_window_lower
For plugins that want fine grained control over window stacking.

https://bugzilla.gnome.org/show_bug.cgi?id=616050
2010-05-05 17:13:08 -04:00
Edward Sheldrake
f8dd4c160b Fix crash when right-clicking on window frame
This is a regression added in 333446ab.

https://bugzilla.gnome.org/show_bug.cgi?id=614592
2010-04-26 17:04:07 -04:00
Vincent Untz
11061a23b1 Fix build with gcc 4.5
Based on patch by Dominique Leuenberger
<dominique-gnomezilla@leuenberger.net>

https://bugzilla.gnome.org/show_bug.cgi?id=606719
2010-04-26 17:02:23 -04:00
Colin Walters
e9fbe4b2c1 Export the functions to control demands_attention
Plugins can want a finer grained control over this.

https://bugzilla.gnome.org/show_bug.cgi?id=616050
2010-04-24 13:13:54 -04:00
Colin Walters
edcb351107 Export methods interact with user_time
This is useful when calling some of the lower level mutter functions,
e.g. controlling window stacking.

https://bugzilla.gnome.org/show_bug.cgi?id=616050
2010-04-24 13:13:54 -04:00
Owen W. Taylor
9915a18810 Avoid triggering strict-aliasing checks when iterating preferences
Rewrite the code to iterate generically over Meta*Preference
arrays to avoid running into GCC's strict-aliasing warnings.

https://bugzilla.gnome.org/show_bug.cgi?id=615672
2010-04-14 22:18:45 -04:00
Owen W. Taylor
b77b0a3d81 Load one copy of plugins early
Although multi-screen support has not been tested and probably
doesn't fully work, the basic setup for multi-screen is that
we have the same list of plugins for all screens, but a different
instance of the plugins for each screen.

To allow plugins to do setup that is screen independent and needs
to occur early in the setup process, we identify a "default plugin
manager" and load (but not start) that plugin manager's plugins
immediately after we know our list of plugins.

That plugin manager is then reused for the first screen we open
and the plugins are started at that time. Separate plugin managers
are loaded and started for any other screens we open.

(A plugin could keep track of whether the screen-independent
setup has been done in a static variable, or it could do everything
in a way that is safe to do repeatedly.)

https://bugzilla.gnome.org/show_bug.cgi?id=615586
2010-04-13 13:53:55 -04:00
Owen W. Taylor
95b260f3a9 Add meta_prefs_override_preference_location()
Allow a plugin to redirect preferences from one GConf location
to another GConf location. This is useful for keys that need to be
set differently in a plugin-managed environment (like GNOME Shell)
as compared to in standalone Metacity.

Overriding is implemented by overwriting the keys in the arrays
of preferences; a list of the current overrides is stored to allow
proper memory management when an override is itself overriden.
(we need to know whether to free the old keys or not)

This patch cleans up the comments in prefs.c a bit as well; some ideas
about less-exciting potential improvements were removed to make the
comments explaining the structure easier to figure out.

https://bugzilla.gnome.org/show_bug.cgi?id=615586
2010-04-13 13:52:39 -04:00
Owen W. Taylor
94d47dc25e Make sure all workspaces have a non-empty, non-null name
The change to using gconf_client_all_entries() in commit 2d57b1b4
meant that workspaces without a GConf key for their name were not
getting a name at all. Fix this by doing a post-processing loop
to set workspace names that were not otherwise set.

Alternate to patch from Tomas Frydrych
https://bugzilla.gnome.org/show_bug.cgi?id=613136
2010-04-13 08:51:06 -04:00
Dan Winship
1abed05413 meta_display_get_keybinding_action: strip out uninteresting modifiers
That is, don't consider the state of num lock, xkb group number, etc,
when looking up keybindings.

https://bugzilla.gnome.org/show_bug.cgi?id=613278
2010-03-18 17:57:47 -04:00
Tomas Frydrych
d537dd93d5 [MetaWindow] Accessor for the instance part of WM_CLASS property
https://bugzilla.gnome.org/show_bug.cgi?id=613128
2010-03-17 16:10:03 +00:00
Colin Walters
650a1e807c [MetaDisplay] Expose meta_display_get_keybinding_action
This can be used when a plugin has control of input to determine
what action would be done, and thus filter to a subset of them.

https://bugzilla.gnome.org/show_bug.cgi?id=613100
2010-03-17 07:22:04 -04:00
Owen W. Taylor
67f8a33cad Include <sys/wait.h> for WIFEXITSTATUS/WIFEXITED
Exit status macros are specified by POSIX to be in <sys/wait.h>.
Fixes compilation on Solaris.

Reported by Brian Cameron
https://bugzilla.gnome.org/show_bug.cgi?id=612506
2010-03-15 11:09:49 -04:00
Owen W. Taylor
8fa83e1be7 Fix fallback to builtin defaults for key bindings
The change to reduce GConf trips by using
gconf_client_all_entries() broke the fallback to builtin values
because update_binding() was no longer called for bindings not
found in GConf. Fix this by keeping track of the bindings we
find from GConf in a hash table, then looping through and setting
all the bindings at the end.

This also improves efficiency by avoiding a linear scan for each
binding in GConf.

https://bugzilla.gnome.org/show_bug.cgi?id=609710
2010-02-18 14:26:12 -05:00
Owen W. Taylor
8875e73765 Fix crash on startup with list bindings
When we are reading bindings initially, update_list_binding() needs
to be passed the correct "string list type" since we are calling
it with a list of strings instead of a list of GConfValue.

https://bugzilla.gnome.org/show_bug.cgi?id=609101
2010-02-18 14:26:12 -05:00
Owen W. Taylor
4cd4010a70 Fix compiling with --disable-gconf
Make the body of meta_prefs_set_clutter_plugins()
conditional on compiling with GConf support.
2010-02-16 15:17:01 -05:00
Florian Müllner
d21da5643b [MetaWindow] Expose maximized state as properties
Add properties for the EWMH _NET_WM_STATE_MAXIMIZED_HORZ and
_NET_WM_STATE_MAXIMIZED_VERT hints.

https://bugzilla.gnome.org/show_bug.cgi?id=590706
2010-02-15 21:40:46 +01:00
Neil Roberts
bd90fd7033 Add the group from cogl_get_option_group() to the GOptionContext
Otherwise it's not possible to use the COGL_DEBUG environment variable.

https://bugzilla.gnome.org/show_bug.cgi?id=609350
2010-02-12 11:40:05 +00:00
Owen W. Taylor
cbac2e7bbb Allow applications to raise windows when raise_on_click is off
Whether Metacity honors a raise request from an application should
not be affected by the raise_on_click setting; remove a check that
seems to have been added in error.

https://bugzilla.gnome.org/show_bug.cgi?id=445447
2010-02-11 13:02:50 -05:00
Owen W. Taylor
88ee4c5b30 Don't focus ancestor window on a different workspace
When we are moving a window with a modal dialog to a different
workspace, meta_workspace_focus_default_window() can be called
with 'not_this_one' being the focused modal dialog.

Since the ancestor of that window is also being moved, we must
not focus it as an alternative to the current window; this will
cause windows to be moved back and Metacity to get into an
inconsistent confused state.

https://bugzilla.redhat.com/show_bug.cgi?id=237158

https://bugzilla.gnome.org/show_bug.cgi?id=598995
2010-02-11 13:02:50 -05:00
Owen W. Taylor
12c46c5d8b Allow explicit raises from same client, not just same app
We currently allow XRaiseWindow when the same application (defined
by the window group) is focused, but the kind of old applications
that XRaiseWindow are frequently not setting the window group.

Expand the check to allow the same X client (defined by the looking
at client ID) to raise windows above the focus window.

https://bugzilla.gnome.org/show_bug.cgi?id=567528
2010-02-11 13:02:50 -05:00
Tomislav Vujec
ab7d4e0e60 Don't warn about a missing session file
When started without session related command line parameters (e.g. from
gnome-session), metacity picks up client_id from the DESKTOP_AUTOSTART_ID
environment variable. Unfortunately, there is no way to distinguish if this was
passed from a config file, representing old saved session, or generated by
gnome-session, therefore load_state is attempted in each case. If the client_id
is generated, there will be no session file, and metacity will report a
warning.

Just remove the warning so that users won't always find a warning at the
start of their .xsession-errors.

https://bugzilla.gnome.org/show_bug.cgi?id=577576
2010-02-11 13:02:49 -05:00
Owen W. Taylor
708c6162c4 Handle XError and XIOError for unknown displays
The atk-bridge GTK+ module opens its own display; if we get an
XIOError on that display, we shouldn't abort with a meta_bug()
but just exit normally. Also fix a segfault if we got an XError
for that display.

https://bugzilla.gnome.org/show_bug.cgi?id=604319
2010-02-11 13:02:49 -05:00
Owen W. Taylor
857c8aaaa2 Make libcanberra support optional
Add a configure switch:

 --with-libcanberra=[yes/no/auto]

(defaulting to auto); if libcanberra is not found or explicitly
disabled, then the default system bell will be used for the bell
sound and no switch workspace sound is played.

https://bugzilla.gnome.org/show_bug.cgi?id=609585
2010-02-11 12:04:11 -05:00
Lennart Poettering
1253e6c64e sound: ask libcanberra to cache alert/desktop switch sounds
These sounds are good candidates for caching in the sound server, to
save a bit of CPU and make reaction faster. Hence, tell libcanberra to
cache them.

https://bugzilla.gnome.org/show_bug.cgi?id=609585
2010-02-11 12:04:10 -05:00
Lennart Poettering
11addbe9c8 bell: increase bell rate limit from 1/s to 1/100ms
Right now metacity issues only 1 bell event per second. This is
feels buggy when triggering multiple alarm sounds in a terminal.

This patch simple increases the limit to 1/100ms. 100ms is probably a
good choice since the HIG recommends that all user reaction should
happen within 100ms. With this applied pressing 'Left' in gnome-terminal
feels much more responsive.

https://bugzilla.redhat.com/show_bug.cgi?id=498608

https://bugzilla.gnome.org/show_bug.cgi?id=609585
2010-02-11 12:04:10 -05:00
Matthias Clasen
709ef05714 Don't force CA_PROP_CANBERRA_ENABLE to 1.
* src/core/bell.c: Don't force CA_PROP_CANBERRA_ENABLE to 1.
That was a misunderstanding on my part, and makes it impossible
to get rid of the bell.

svn path=/trunk/; revision=4165

https://bugzilla.gnome.org/show_bug.cgi?id=609585
2010-02-11 12:04:10 -05:00
Matthias Clasen
c51767eef1 Now that we are using libcanberra, don't tell the X server to play the bell
* src/core/bell.c (meta_bell_set_audible): Now that we are
using libcanberra, don't tell the X server to play the system
bell internally.

svn path=/trunk/; revision=4141

https://bugzilla.gnome.org/show_bug.cgi?id=609585
2010-02-11 12:04:10 -05:00
Matthias Clasen
5aab9e878f Use libcanberra to play system bell and workspace switch sounds
Patch by Lennart Poettering

* configure.in: Require libcanberra-gtk

* src/core/bell.c (meta_bell_notify): Play the alert sound from
the sound theme instead of the dreaded system bell.

* src/core/workspace.c (meta_workspace_activate_with_focus): Play
a sound on workspace switch.

https://bugzilla.gnome.org/show_bug.cgi?id=557921

https://bugzilla.gnome.org/show_bug.cgi?id=609585
2010-02-11 12:04:10 -05:00
Matthias Clasen
2d57b1b470 Reduce GConf roundtrips
metacity tries to do the right thing, by preloading all the relevant
directories before getting the keys one-by-one, but GConfClient isn't actually
smart enough to avoid server roundtrips in this case. That should certainly be
fixed in GConf.

In the meantime, here is a patch that reworks the metacity prefs initialization
to avoid roundtrips for individual keys anyway, by using
gconf_client_all_keys().

https://bugzilla.gnome.org/show_bug.cgi?id=574121
https://bugzilla.gnome.org/show_bug.cgi?id=607746
2010-02-10 14:32:48 -05:00
Vincent Untz
6638d0e507 Increase ping timeout delay to 5s
https://bugzilla.gnome.org/show_bug.cgi?id=568790
2010-02-10 12:49:15 -05:00
Peter Bloomfield
c6793d477a Prevent window self-maximisation
https://bugzilla.gnome.org/show_bug.cgi?id=461927
2010-02-10 12:48:10 -05:00
alexisdm59
11e01ec074 check window has frame before flashing it
https://bugzilla.gnome.org/show_bug.cgi?id=598231
2010-02-10 12:25:40 -05:00
Owen W. Taylor
1d827caaaf Don't call IceCloseConnection() behind libSM's back
The ICE connection is opened by libSM; we can't just close it when
we get an IOError on the ICE connection; instead call SmcCloseConnection()
and mark the connection as closed. This will prevent a segfault if we
exit out of the metacity main loop and get to meta_finalize().

https://bugzilla.gnome.org/show_bug.cgi?id=604867
2010-02-10 12:25:40 -05:00
Travis Watkins
ba4db78ed9 store timestamp for _NET_WM_CM_SX selection
https://bugzilla.gnome.org/show_bug.cgi?id=530702
2010-02-10 12:25:20 -05:00
Thomas Thurman
a321f4c842 Throw away result of write(); it's not important 2010-02-10 12:19:01 -05:00
Claude Paroz
b1c465eab0 Remove markup from translated string 2010-02-10 12:17:43 -05:00
Ray Strode
5134b05af9 Don't call meta_finalize from SIGTERM handler
It's not a legal function to call from a signal handler.
Instead defer until going back to the main loop.

https://bugzilla.gnome.org/show_bug.cgi?id=600864
2010-02-10 12:16:46 -05:00
Owen W. Taylor
dc3a93be99 Add XFCE Terminal as a terminal
Include the XFCE terminal program 'Terminal' in the list of terminals.

https://bugzilla.gnome.org/show_bug.cgi?id=599262
2010-02-10 12:12:58 -05:00
Matthias Clasen
11d0d207fd unset _NET_SUPPORTING_WM_CHECK when shutting down 2010-02-10 12:10:55 -05:00
Tomeu Vizoso
eed3245b1b Add a switch to disable autofullscreen'ing maximized windows without decorations 2010-02-10 12:04:42 -05:00
Matt Kraai
a7bbde1699 Don't define meta_spew_event unless verbose mode is on. Closes #571126.
svn path=/trunk/; revision=4132
2010-02-10 11:13:30 -05:00
Matt Kraai
bacccafe3c Only put demands-attention windows into alt-tab if of appropriate type
Windows demanding attention should never appear in the alt-tab list
unless they're of a type which might have appeared there anyway. This
solves a problem under AWN where docks which were marked as demanding
attention appeared in all alt-tab lists; they were irrelevant and it
was impossible to remove them from the lists.

svn path=/trunk/; revision=4123
2010-02-10 11:12:41 -05:00
Owen W. Taylor
c588e173f8 Remove the year number from the copyright string into a constant
(This is inspired by Metacity commit 45cbaa2 by Thomas Thurman, but
much simpler - the use of g_date_strftime("%Y") ended up being just
%d for all 90+ current translations)
2010-02-10 10:27:48 -05:00
Owen W. Taylor
6ffe5f8343 meta_workspace_set_builtin_struts(): optimize out non-changes
meta_workspace_set_builtin_struts() is slightly expensive; it involves
discarding all our cached computed information about the layout of the
workspace. So catch calls to set_builtin_struts() that don't change
anything.

https://bugzilla.gnome.org/show_bug.cgi?id=609546
2010-02-10 09:56:47 -05:00
Owen W. Taylor
2a823ef3e4 Fix crash when struts change during grab operation
Since meta_workspace_invalidate_work_area() frees the edges
workspace->screen_edges and workspace->monitor_edges, we must clean up
our cached edge resistance data when the invalidate_work_area() is
called on the active workspace, or when the workspace changes.

Make the computation of the edge resistance data lazy so that it
will be recomputed the next time we try to access it.
meta_display_compute_resistance_and_snapping_edges() is made
private to edge-resistance.c

Invaliding the data when active workspace changes also will improve
correctness for edge resistance when the current workspace changes
during a grab operation. (Even with this fix we still don't try to
handle window positions changing during a grab operation; that can't
cause a crash since, unlike screen and monitor edges, the window edges
are freshly allocated, it will just cause slight oddness in that
corner case.)

Root cause tracked down due to much effort by Jon Nettleton.
https://bugzilla.gnome.org/show_bug.cgi?id=608800
2010-02-09 17:00:20 -05:00
Dan Winship
576417648a Work around Xlib 64-bit "specialness"
When putting 32-bit properties into longs on 64-bit architectures,
XGetWindowProperty assumes the values are supposed to be signed, and
so it sign-extends values greater than 0x7fffffff. So if they *aren't*
supposed to be signed, we need to chop off the high bits ourselves.

(Most CARDINAL-valued properties only end up using small values
anyway, so it doesn't matter, but _NET_WM_WINDOW_OPACITY uses the full
range, and so was previously failing on 64-bit machines.)

https://bugzilla.gnome.org/show_bug.cgi?id=605678
2010-01-25 11:07:32 -05:00
Owen W. Taylor
14987f2b21 Remove XOR gc only used in removed reduced-resources mode
Remove screen.root_xor_gc; this was only used for XOR drawing
in reduced-resources mode, which was removed.

https://bugzilla.gnome.org/show_bug.cgi?id=602740
2009-11-24 15:40:35 -05:00
Dan Winship
988d2ffab6 Fix handling of SIGCHLD
The commit that removed metacity-dialog added a global SIGCHLD handler
that caused problems by (a) calling waitpid(-1) and thus breaking
g_child_watch for everyone else, and (b) doing too much from a signal
handler and sometimes causing deadlocks (bug 596200).

This removes the global handler and has each zenity user create its
own child watch to watch for exit. (It also fixes the window class of
the zenity dialogs, so that meta_window_present_delete_dialog() will
work again.)
2009-11-20 11:15:58 -05:00
Tomas Frydrych
5e2c66e241 [MetaDisplay] added "window-marked-urgent" signal
Having a MetaDisplay window-marked-urgent signal when a window sets its urgent
hint allows for centralized processing

https://bugzilla.gnome.org/show_bug.cgi?id=600068
2009-11-20 08:57:36 +00:00
Tomas Frydrych
0ccfb0d781 [MetaWindow] added urgent property
Property tracking ICCCM urgency hint

https://bugzilla.gnome.org/show_bug.cgi?id=600068
2009-11-20 08:51:19 +00:00
Tomas Frydrych
7579b691df [MetaDisplay] Added window-demands-attention signal
Having a MetaDisplay::window-demands-attention signal allows to deal with
windows demanding attention in a cetralized fashion.

The signal is emitted when a window is created with initial demands-attention
state and/or when the state changes later on.

Based on original patch by Jon Nettleton.

https://bugzilla.gnome.org/show_bug.cgi?id=597052
2009-11-17 10:06:25 +00:00
Tomas Frydrych
2a14deab0c [MetaWindow] Added boolean demands-attention property
https://bugzilla.gnome.org/show_bug.cgi?id=588065
2009-11-17 10:06:06 +00:00
Owen W. Taylor
fb45b8f45c Correctly initialize window->input field
With the change from bug 582639, we no longer call the reload
functions for properties that are not initially set, so the
initialization of fields in window.c has to match what
window-props.c would set for a missing property.

There was only one discrepancy, window->input, which needs
to be set to TRUE by default (or a window missing a WM_HINTS
property won't get focus); we also add explicit initializers
for a couple of fields that were getting 0-initialized
to the correct default value of FALSE for consistency with
the explicit intialization of the rest of the fields.

Bug reported by Dominique Leuenberger
https://bugzilla.gnome.org/show_bug.cgi?id=601228
2009-11-12 13:57:11 -05:00
Maxim Ermilov
d59a9c2e8a Correct meta_workspace_list_windows annotation.
https://bugzilla.gnome.org/show_bug.cgi?id=591912
2009-11-12 11:50:07 -05:00
Colin Walters
9311addca3 Add "window-created" signal to MetaDisplay, "unmanaged" signal for MetaWindow
For some consumers it's significantly more convenient to be able
to directly connect to a signal on the Window to know when
Mutter is done with it, rather than having to connect to each
Workspace object (and handle workspace additions, etc.).

Similarly, add window-created which acts globally.

https://bugzilla.gnome.org/show_bug.cgi?id=598289
2009-10-14 14:39:33 -04:00
Owen W. Taylor
e8a29c1e82 Work around race condition focusing a window on a different workspace
When we focus a window on a different desktop, and the calc_showing
idle that hides/shows the windows gets run before we get focus events
back from X, we think that we are hiding the window with the focus
so we focus a "random" window to avoid leaving the user with no focus.

Work around this temporarily by checking display->expected_focus_window;
this isn't a perfect fix because there are cases where
display->expected_focus_window corresponds to a window we tried to
focus in the past but failed, but it makes things work fairly well.

https://bugzilla.gnome.org/show_bug.cgi?id=597352
2009-10-07 17:28:04 -04:00
Tomas Frydrych
8589e4f3d3 [MutterScreen] Added workareas-changed signal
This signal is emitted when workarea of any workspace belonging to the screen
changes.

https://bugzilla.gnome.org/show_bug.cgi?id=597009
2009-10-07 12:07:00 +01:00
Tomas Frydrych
948e54772d [MutterWindow] Added meta_window_get_transient_for_as_xid()
Accessor for the transient xid hint.

https://bugzilla.gnome.org/show_bug.cgi?id=597010
2009-10-07 11:56:49 +01:00
Owen W. Taylor
083854e2de Create the dummy timeline for repaint laters with an "infinite" duration.
When we create the timeline dummy timeline to ensure that our later
functions that should be run during repaint get called called, pass in
G_MAXUINT to make the duration very long, not 0. (It will get reset
whenever there is no repaint later to run, so the fact that G_MAXUINT
is only ~40 days isn't a problem.)

This fixes a warning from Clutter, but also a real problem.
2009-10-02 16:12:11 -04:00
Owen W. Taylor
3508c4aa87 Use "later functions" to fix priority problems with Clutter redraw
There was a problem where if, for example, a restack was triggered
out of a clutter event handler, then after Clutter processed the
events, it would proceed immmediately on to repaint the stage without
ever returning control to the GLib main loop. So even though we
had an idle handler installed with a higher priority than the
Clutter stage repainting the clutter stage repainting would happen
first and we'd get a wrong frame.

Fix this by introducing the idea of "later functions", which abstract
the idea of "doing something later" away from g_idle_add() and use
a combination of GLib idle functions and Clutter "repaint functions"
to get our callbacks triggered at the right time, even when they
are installed from a clutter event handler.

https://bugzilla.gnome.org/show_bug.cgi?id=596334

This also resolve a FIXME where MUTTER_PRIORITY_BEFORE_REDRAW
could starve stage repainting.
2009-10-02 15:50:16 -04:00
Dan Winship
d04b15ee25 Remove MetaAltTabHandler
gnome-shell is no longer using MetaAltTabHandler, so there's no need
to keep that abstraction around.

This reverts commit 1d5117a6 (and a comment from 7b0ba87b), with a bit
of rebasing and whitespace cleanup.

https://bugzilla.gnome.org/show_bug.cgi?id=596210
2009-10-02 15:47:49 -04:00
Colin Walters
d399141d13 Add meta_window_get_stable_sequence
Useful for plugins which want to order windows in a stable
fashion.

https://bugzilla.gnome.org/show_bug.cgi?id=595882
2009-09-22 12:43:35 -04:00
Owen W. Taylor
0b86343dd0 Export a _GNOME_WM_KEYBINDINGS property
We need a way to indicate to gnome-control-center that we want the
keybindings capplet to show the Window Manager keybindings for Metacity;
do this through a _GNOME_WM_KEYBINDING property we put on the
_NET_SUPPORTING_WM_CHECK window and set to Mutter,Metacity.

See http://bugzilla.gnome.org/show_bug.cgi?id=594066 for the
gnome-control-center part of this.

http://bugzilla.gnome.org/show_bug.cgi?id=594067
2009-09-04 18:25:39 -04:00
Colin Walters
8f3da9f68a Use meta_window_set_user_time for setting user time consistently
This is a followup to making user-time a GObject property, this
way we get notifications.
2009-09-03 20:58:19 -04:00
Colin Walters
4c1998f137 Annotate meta_screen_get_active_workspace as (transfer none) 2009-09-03 20:57:39 -04:00
Colin Walters
84dc1c1b85 [MetaWindow] Make user-time a GObject property
Notification of changes are useful for code ordering windows.
2009-09-03 20:57:39 -04:00
Dan Winship
c10467d22e Add meta_screen_get_n_monitors() and meta_screen_get_monitor_geometry()
http://bugzilla.gnome.org/show_bug.cgi?id=593686
2009-08-31 18:57:29 -04:00
Dan Winship
3a1e492afc Refer to monitors as "monitors" rather than "xineramas"
http://bugzilla.gnome.org/show_bug.cgi?id=593686
2009-08-31 14:39:48 -04:00
Colin Walters
81183c71c1 Add public meta_window_get_user_time
Useful for sorting windows by interaction time.
2009-08-30 20:18:11 -04:00
Steve Frécinaux
7e0087304b Add meta_window_is_skip_taskbar
Accessor for the 'skip-taskbar', which will allow gnome-shell not to
consider windows with this hint in its overview thunbnails.
2009-08-28 19:05:17 +02:00
Owen W. Taylor
20b02e738c Make MUTTER_DEBUG_XINERAMA override active Xinerama
It seems a bit cleaner to make the MUTTER_DEBUG_XINERAMA variable
that sets up fake Xinerama take effect even if Xinerama is active;
this means we don't count on Xinerama (or Xrandr if we switch tot
that) special casing the case of one monitor.

http://bugzilla.gnome.org/show_bug.cgi?id=593404
2009-08-28 12:57:29 -04:00
Owen W. Taylor
d042dba4d6 Add meta_display_get_grab_op()
Add a function to determine the current grab op. This can be useful
in a plugin to avoid over-grabbing an X grab held by Mutter.

http://bugzilla.gnome.org/show_bug.cgi?id=593399
2009-08-28 12:27:46 -04:00
Volker Sobek
a69ce37546 Unminimize windows passed to meta_workspace_activate_with_focus()
Unminimize minimized windows passed to meta_workspace_activate_with_focus()
by calling meta_window_activate() on them instead of meta_window_focus()
and meta_window_raise(). This fix makes sense because for the existing
usage inside Mutter meta_workspace_activate_with_focus() is never called
on a minimized window and for calls from outside Mutter there is no
point in focusing a minimized window without unminimizing it first.

Add a doc comment to meta_workspace_activate_with_focus().

http://bugzilla.gnome.org/show_bug.cgi?id=592393
2009-08-28 12:10:41 -04:00
Tomas Frydrych
3e09b4a725 Check for NULL in meta_screen_tab_popup_destroy() instead of asserting
This function is getting called even when no MetaAltTabHandler object is
installed on the screen, so we need to handle the NULL gracefully.
2009-08-27 17:49:13 +01:00
Owen W. Taylor
7b0ba87b24 Fix custom-alt-tabs for single-handling of key events
The changes to enforce single handling of all key events were breaking
custom-alt-tab keypress handlers, since that code was assuming that
key event would get to process_tab_grab(), and then maybe to
process_event() and then to the plugin's xevent_filter to detect a
key release.

We centeralize all of this handling into process_tab_grab() and either

 - Invoke a custom handler for the key press
 - Select the current window on modifier release by calling a  new
   pseudo-binding "tab_popup_select"
 - Cancel the grab on an unbound key by calling a new pseudo-binding
   "tab_popup_cancel"

http://bugzilla.gnome.org/show_bug.cgi?id=590754
2009-08-26 12:26:58 -04:00
Owen W. Taylor
67682a2683 Add a modal mode for plugins
mutter_plugin_begin_modal() and mutter_plugin_begin_modal() allow putting
a plugin into a "modal" state. This means:

 - The plugin has the keyboard and mouse grabbed
 - All keyboard and mouse events go exclusively to the plugin

mutter-plugin.[ch]: Add public API
compositor.c compositor-private.h: Implement the API
mutter-plugin-manager.c: When reloading plugins, make sure none of them
  are modal at that moment, and if so force-unmodal them.
common.h: Add META_GRAB_OP_COMPOSITOR
display: When display->grab_op is META_GRAB_OP_COMPOSITOR forward relevant
  events exclusively to the compositor.

http://bugzilla.gnome.org/show_bug.cgi?id=590754
2009-08-26 12:26:58 -04:00
Owen W. Taylor
b1776b5ae5 Enforce a policy of single-handling of key events
Only process each key event once. If all keys are grabbed, then
don't also look for handlers for a key shortcut after processing
the grab op. If all keys are grabbed or we find a key shortcut,
don't pass the event on to the compositing mananger.

http://bugzilla.gnome.org/show_bug.cgi?id=590754
2009-08-26 12:26:58 -04:00
Thomas James Alexander Thurman
7a6968cb46 Only skip the first window in the alt-tab chain if it's actually the
* src/core/display.c: Only skip the first window in
        the alt-tab chain if it's actually the current window
        (urgent windows on other workspaces may precede it).
        Fixes #535887.

http://bugzilla.gnome.org/show_bug.cgi?id=591913

(Metacity commit 92bfe34716)
2009-08-26 15:29:09 +01:00
Owen W. Taylor
d58c9a57c6 Avoid accessing freed memory when being replaced
If we are replaced via the window manager selection, then we close
the MetaDisplay before meta_finalize() runs. We should be careful
not to try to close the display again (and access already freed
memory) in that case, so clear the global 'the_display' variable.

See Metacity bug http://bugzilla.gnome.org/show_bug.cgi?id=588119

http://bugzilla.gnome.org/show_bug.cgi?id=592742
2009-08-24 14:29:16 -04:00
Colin Walters
01581dc61c [MetaWindow]: Always notify on title property change
The previous notification code was attempting to use the "modified"
boolean returned from set_title_text, but "that boolean doesn't mean
what you think it means".  It actually means "I truncated the title".

Just always notify, it's far simpler than trying to compute
when we don't need to, and callers can compress if they really need
to.
2009-08-21 12:38:30 -04:00
Colin Walters
9cc70a3fb6 Make meta_display_xwindow_is_a_no_focus_window public
Useful for window analysis in plugins.
2009-08-20 14:20:01 -04:00
Colin Walters
41cf9134a6 Add meta_window_is_mapped, remove usage of window-private.h from mutter-window.c
mutter-window.c originally grew an #include "window-private.h" for
window->override_redirect, but that was just fixed.  However since
then it also ended up relying on a few other minor private bits.

To fix that, add meta_window_is_mapped, promote meta_window_toplevel_is_mapped
to public, and use the public MetaDisplay accessor.
2009-08-14 19:47:13 -04:00
Colin Walters
e960269653 Add meta_window_is_override_redirect
Trivial function, useful for plugins which are doing analysis
of windows.
2009-08-14 19:47:13 -04:00
Owen W. Taylor
91baf552cf Remove meta_errors_register_foreign_display()
The functionality to propagate errors for other displays to other
a "foreign error handler" was Soeren's compositor and is no longer
being used. Remove it.

(Now that error.h is being installed and scanned, we need to either
do this or add XErrorEvent to xlib-2.0.gir and rename ErrorHandler
to MetaErrorHandler. This way is a bit simpler.)
2009-08-13 07:38:08 -04:00
Tomas Frydrych
f3e6913d57 Added meta_window_is_modal()
Queries whether the window is in a modal state, as per the _NET_WM_STATE
protocol.
2009-08-12 07:49:08 +01:00
Colin Walters
422cd1fbbf Fix use of uninitialized memory in edge-resistance.c
g_new bad, g_new0 good.
2009-08-09 23:40:22 -04:00
Colin Walters
8a9e2877da Export meta_screen_get_startup_sequences, add change signal
It's useful for plugins to be able to get access to the
startup-notification data that Mutter already has.  Add
an accessor and change signal when recieve an event.
2009-08-09 23:36:08 -04:00
Tomas Frydrych
ae32ac86b4 Use correct timestamp for focus stealing prevention
When window initially maps, use the more recent of NET_WM_USER_TIME and
startup notification timestamps to compare against last known user action to
decide whether to focus the window or not. Once we show the window, clear
the initial_timestamp_set flag, so the startup notification timestamp is not
taken into account again.

Based on patch for metacity by Alexander Larsson

http://bugzilla.gnome.org/show_bug.cgi?id=573922
2009-08-08 17:59:01 +01:00
Owen W. Taylor
15376957f7 Don't allow override-redirect windows to be META_WINDOW_NORMAL
Many override-redirect windows (including the Metacity UI windows!)
will have NET_WM_WINDOW_TYPE_NORMAL set on them because of shared
code paths with normal windows in toolkits.

Some current Compositor plugins (default plugin and gnome-shell)
check type == NORMAL to determine if to run effects. While fixing
such plugins to also check if the window is override-redirect is
posisble, it seems cleanest to simply not allow any of the decorated
window types to be set on an override-redirect window and to force
these types to META_WINDOW_OVERRIDE_OTHER. This will prevent other
similar problems from showing up in the future.

http://bugzilla.gnome.org/show_bug.cgi?id=590971
2009-08-06 12:16:24 -04:00
Tomas Frydrych
3eee6b4218 Handle FocusIn events for override redirect windows correctly
Do not try to insert / remove the window from the MRU list; just reset the
MetaDisplay focus window to NULL.

http://bugzilla.gnome.org/show_bug.cgi?id=590611
2009-08-04 14:31:13 +01:00
Xu Li
2f63d321d1 [constraints] Avoid overflow when window maximum size hint is set to INT_MAX
When calculating maximum permissible size of our frame window, we need to
avoid an overflow if the application set its max size hint to INT_MAX.

http://bugzilla.gnome.org/show_bug.cgi?id=590627
2009-08-04 08:38:56 +01:00
Tomas Frydrych
2222cb8fbf Added public prototype for meta_window_is_ancestor_of_transient()
http://bugzilla.gnome.org/show_bug.cgi?id=590439
2009-08-04 08:32:36 +01:00
Tomas Frydrych
897814a153 Added MetaWindow::window-type property
Read-only property for querying the type of MetaWindow.

http://bugzilla.gnome.org/show_bug.cgi?id=588230
2009-08-04 08:06:30 +01:00
Tomas Frydrych
8b7b41df41 Accessors for pid and name of client machine associated with MetaWindow
http://bugzilla.gnome.org/show_bug.cgi?id=590388
2009-08-04 07:58:11 +01:00
Tomas Frydrych
8f9a174f0a Fixed warnings due to missing casts 2009-08-01 11:11:11 +01:00
Colin Walters
df90187e06 Add focus-window property to MetaDisplay
Useful mainly for notify::focus-window.
2009-08-01 04:38:26 -04:00
Tomas Frydrych
c9e0613b53 Set up correct initial values for override redirect windows
As a sideffect of commit a576f7a1ea, override
redirect windows of type _NET_WM_WINDOW_TYPE_NORMAL do not have their
features recalculated during MetaWindow construction (same as regular
windows of type _NET_WM_WINDOW_TYPE_NORMAL), so we need to set the initial
values accordingly.
2009-08-01 09:11:06 +01:00
Tomas Frydrych
a576f7a1ea Tolerate all standard _NET_WM_WINDOW_TYPE types for managed windows
Although the spec designates some window types as typically used for
override redirect windows, it does not prohibit the use of these with
managed windows, so we should not abort if we encounter one of these.

http://bugzilla.gnome.org/show_bug.cgi?id=583870
2009-07-31 19:11:54 +01:00
Owen W. Taylor
239b39cf52 Pass through all scroll events to compositor
As with other events, we want to pass through scroll events (button 4/5 presses)
to the compositor, whether or not they are associated with a particular MetaWindow;
do this by simply falling through to the normal code path instead of
separately delivering the events to the compositor.

http://bugzilla.gnome.org/show_bug.cgi?id=588232
2009-07-31 10:37:26 -04:00
Owen W. Taylor
6726fcd25d Simplify relationship between mapping and visibility
Previously, changes to the visibility of a window could be indicated
by meta_compositor_map_window(), meta_compositor_unminimize_window(),
meta_compositor_set_window_hidden(), etc, with the exact behavior
depending on the 'live_hidden_windows' preference.

Simplify this so that visibility is controlled by:

 meta_compositor_show_window()
 meta_compositor_hide_window()

With an 'effect' parameter provided to indicate the appropriate
effect (CREATE/UNMINIMIZE/MINIMIZE/DESTROY/NONE.)

The map state of the window is signalled separately by:

 meta_compositor_map_window()
 meta_compositor_unmap_window()

And is used only to control resource handling.

Other changes:

 * The desired effect on show/hide is explicitly stored in
   MetaWindow, avoiding the need for the was_minimized flag.
   At idle, once we calculate the window state, we pass the
   effect to the compositor if it matches the new window
   state, and then clear the effect to start over for future
   map state changes.

 * meta_compositor_switch_workspace() is called before any windows
   are hidden or shown, allowing the compositor to avoid hiding
   or showing an effect for windows involved in the switch.
   http://bugzilla.gnome.org/show_bug.cgi?id=582341

 * Handling of post-effect cleanups for MutterWindow are
   simplified - instead of trying to do different things based
   on the individual needs of different effects, we just wait until
   all effects complete and sync the window state to what it
   should be.

 * On unmap, once we destroy the pixmap, we tell ClutterX11Pixmap
   that we've done so, so it can clean up and unbind. (The
   unbinding doesn't seem to be working properly because of
   ClutterGLXPixmap or video driver issues.)

http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-07-06 00:16:23 +01:00
Owen W. Taylor
9244f0f113 Move window repair and reshape to a paint function
Add a paint function that checks all windows for repair and
shape updates; this:

 - simplifies the logic for when a window needs to be repaired
 - avoids duplicate work when we get multiple damage effects
 - avoids the need to look ahead in the event queue

Instead of relying on repair to implicitly resize the
MutterWindow actor, set the size explicitly when the core
code updates the geometry. (This is needed because we haven't
repaired yet when we start an animation, and the animation
may depend on the size to, e.g., rescale from the center.)

Because the core geometry update happens before we start
maximize/unmaximize effects we need to work around this by
passing both the old and new geometry to the compositor.

http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-07-06 00:04:41 +01:00
Owen W. Taylor
bc9a2cc92a Don't move hidden windows to the desktop layer
Putting hidden windows in the desktop layer is pointless - in
the desktop layer isn't necessary below all visible windows,
and we are hiding the windows by other means. And the movement
isn't reliable because nothing sets stack->needs_relayer, so
windows can get stuck in the desktop layer after being
rehidden.

http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-07-05 23:57:06 +01:00
Milan Bouchet-Valat
2c17ef4803 Emit signals when workspaces are added, removed or switched
The patch adds GLib marshalling code to Mutter, since it's required for the "workspace-switched" signal.
The definition of MetaMotionDirection enum is moved to common.h since it's now used in workspace.c.
A little cleaning is done in workspace.c:meta_workspace_activate_with_focus(), where compositor-specific code is merged with the rest of the function (required to emit signal), removing #ifdefs.
2009-07-04 10:57:52 +02:00
Colin Walters
32251dcf4e Make meta_workspace_list_windows public
It's a useful way to list windows, and already
documented and annotated.
2009-06-30 14:38:33 -04:00
Jon Nettleton
94f64797de Remove wireframe mode and old effects framework
Remove the reduced_resources preference and all all wireframe logic and effects.

http://bugzilla.gnome.org/show_bug.cgi?id=581812
2009-06-30 09:35:12 -04:00
Owen W. Taylor
d69546902b Remove unused MetaCompositor functions
Remove a number of functions that were either entirely unimplemented
or had empty implementations for the Clutter-compositor.

 meta_compositor_begin_move()
 meta_compositor_update_move()
 meta_compositor_end_move()
 meta_compositor_set_active_window()
 meta_compositor_free_window()

http://bugzilla.gnome.org/show_bug.cgi?id=581813
2009-06-30 09:35:12 -04:00
Owen W. Taylor
3aff9726eb Remove MetaCompositor virtualization
Now that we only have one compositor, there's no reason to access the
compositor functions through a vtable. Remove the MetaCompositor virtualization
and make the clutter code implement the meta_compositor_* functions
directly.

Move the checks for the compositor being NULL from the vtable wrappers
to the calling code (most of them were already there, so just a few
needed to be added)

Note: the compositor is actually hard-coded on at the moment and the plan
  is to remove the non-composited code entirely, so the checks are
  added only to keep things neat: they have no practical effect.

http://bugzilla.gnome.org/show_bug.cgi?id=581813
2009-06-30 09:34:45 -04:00
Jon Nettleton
0b8a57bcba There can be only one compositor engine
Mutter is a Clutter-based compositing manager. So, remove the code for
the XRender-based compositor, and make it mandatory to have XComposite,
XRender and Clutter.

Run-time support for non-composited operation is left for now.

* src/compositor/mutter/: Move files from this subdirectory into
  the main compositor/ directory.

* compositor/compositor-xrender.ccompositor/compositor-xrender.h:
  Remove

* include/compositor-clutter.h: Remove this stray file, it had been
  replaced with compositor-mutter.h some time back.

http://bugzilla.gnome.org/show_bug.cgi?id=581813
2009-06-30 09:34:03 -04:00
Owen W. Taylor
43511c316e Use MetaStackTracker to avoid a round-trip XQueryTree()
With MetaStackTracker, it's no longer necessary to XQueryTree to
get a reasonably-up-to-date view of the server stacking order.

Add some comments explaining unclear aspects of
raise_window_relative_to_managed_windows() and with future possible
improvements.

http://bugzilla.gnome.org/show_bug.cgi?id=585984
2009-06-29 23:05:11 -04:00
Owen W. Taylor
34e4b594cd Don't do stacking for override-redirect windows
Don't add override-redirect windows to MetaStack; we shouldn't
be restacking them.

Since we *aren't* stacking the override-redirect windows, we need to
be careful that to ignore them when looking for the top managed
window.

http://bugzilla.gnome.org/show_bug.cgi?id=585984
2009-06-29 23:05:11 -04:00
Owen W. Taylor
6314ee8780 Move compositor-stack handling to MetaStackTracker
In order to properly track the stacking order for override-redirect
windows, move meta_compositor_sync_stack() call into MetaStackTracker.
In the new location, we sync the stack as a before-redraw idle function,
rather then using the freeze-thaw facilities of MetaStack. This is
simpler, and also properly compresses multiple stack changes on
notifications received from the X server.

http://bugzilla.gnome.org/show_bug.cgi?id=585984
2009-06-29 23:05:11 -04:00
Owen W. Taylor
a4cd66f599 Add better tracking of real stacking order
Wedging override-redirect windows into the constraint code in stack.c
results in Mutter getting confused about the stacking order of
these windows with respect to other windows, and may also in some
cases cause Mutter to restack override-redirect windows.

core/stack-tracker.c core/stack-tracker.h: MetaStackTracker - combine
  events received from the X server with local changes we have made
  to come up with the best possible idea of what the stacking order
  is at any one point in time.

core/screen.c core/screen-private.h: Create a MetaStackTracker for
  the screen.

core/display.c: Feed relevant events to MetaStackTracker

core/frame.c core/screen.c core/stack.c: When we make changes to the
  stacking order or add windows, record those changes immediatley
  in MetaStackTracker so we have the information without waiting
  for a round-trip.

include/ui.h ui/ui.c: meta_ui_create_frame_window add a return value
  for the X request serial used to create the window.

http://bugzilla.gnome.org/show_bug.cgi?id=585984
2009-06-29 23:04:59 -04:00
Owen W. Taylor
729fb2e0b4 Avoid moving and resizing override-redirect windows
Override-redirect windows should not be moved or resized by the
window manager.

- Mark override-redirect windows as already placed to avoid
  placing them when first shown.
- Don't move-resize newly created override-redirect MetaWindow
- Don't queue a resize on override-redirect windows when reading
  their WM_TRANSIENT_FOR hint.
- Add g_return_if_fail (!window->override_redirect) to catch
  unexpected code paths that might result in override-redirect
  windows being moved or resized.

http://bugzilla.gnome.org/show_bug.cgi?id=582639
2009-06-29 22:54:38 -04:00
Owen W. Taylor
dc2d8acc92 Don't add override-redirect windows to workspaces
Normally a window that is "on all workspaces", is also on a particular
workspace (to deal with being unstuck.) This is pointless for
override-redirect windows.

http://bugzilla.gnome.org/show_bug.cgi?id=582639
2009-06-29 22:51:40 -04:00
Owen W. Taylor
f7c595ff18 Ignore client messages sent to override-redirect windows
If someone asks us to close, maximize, etc, an override-redirect
window, just ignore the request.

http://bugzilla.gnome.org/show_bug.cgi?id=582639
2009-06-29 22:51:40 -04:00
Owen W. Taylor
3d81a1e5ec meta_screen_foreach_window(): Skip override-redirect windows
Don't include override-redirect windows when iterating the windows
in the screen. We don't need them for any of the current uses:

 - Queueing redraws and resizes on managed windows
 - Checking which windows should be added to a new workspace

http://bugzilla.gnome.org/show_bug.cgi?id=582639
2009-06-29 22:51:40 -04:00
Owen W. Taylor
00d955eb40 meta_display_list_windows: Exclude override-redirect
Don't include override-redirect windows in the list return by
meta_display_list_windows(), since we almost never want to handle
them when considering "all window" for the display. Add a separate
meta_display_list_all_windows() that includes override-redirect
windows.

http://bugzilla.gnome.org/show_bug.cgi?id=582639
2009-06-29 22:51:32 -04:00
Owen W. Taylor
fd27647440 Don't read most properties for override-redirect windows
Skipping handling of properties for override redirect windows has
two advantages: first it reduces the amount of work needed to get
an override-redirect window (menu, tooltip, drag icon) onto the
screen. But more importantly, it reduces the number of code-paths
for an override-redirect to get into some code portion where it
isn't expected.

* Integrate the list of properties we load initially with the
  list of property hooks; this avoids having two separate lists
  that we have to keep in sync.

* Add a flag to MetaWindowPropHooks to indicate whether the
  property should be handled for override-redirect windows;
  currently we load a) properties that identify the window -
  useful for debugging purposes b) WM_TRANSIENT_FOR (could be
  used to associate menus with toplevels.)

* For properties that aren't always loaded through window-props.c,
  add !window->override checks to places that trigger loading,
  and add g_return_if_fail(!window->override) to the load
  functions as a double-check.

http://bugzilla.gnome.org/show_bug.cgi?id=582639
2009-06-29 22:32:19 -04:00
Owen W. Taylor
27fb5fbbca Add checks against inappropriate changes to override-redirect window
Add g_return_if_fail() to check that window-management functions like
meta_window_maximize() aren't called on override-redirect windows.

This reveals that were were "unminimizing" override-redirect windows
when adding them; avoid doing that.

http://bugzilla.gnome.org/show_bug.cgi?id=582639
2009-06-29 22:29:32 -04:00
Owen W. Taylor
d810315884 Fix property notifications for certain properties
If a property has a reload function, but the standard property-fetching
mechanism isn't used (hooks->type == META_PROP_VALUE_INVALID), then the
a logic error (introduced in January) caused the hook to never be run.

This meant that changes to struts and icons weren't noticed.

Same as: http://bugzilla.gnome.org/show_bug.cgi?id=572573
The fix here is different in detail from that applied to Metacity, but
similar in spirit.

http://bugzilla.gnome.org/show_bug.cgi?id=585980
2009-06-29 22:29:31 -04:00
Owen W. Taylor
820970328b Load NET_WM_USER_TIME from the right window
On subsequent changes, if there is a NET_WM_USER_TIME_WINDOW, then
read the property from that rather than from the main window.
(Fix an accidental regression: the right Window was being computed
but no longer passed in.)

http://bugzilla.gnome.org/show_bug.cgi?id=585979
2009-06-29 22:29:31 -04:00
Owen W. Taylor
3e2fcf4acd Fix missing static for meta_window_show()
Definition of meta_window_show() was missing static although it
was forward-declared with static.

http://bugzilla.gnome.org/show_bug.cgi?id=585978
2009-06-29 22:29:31 -04:00
Owen W. Taylor
c012105b90 Fix hiding newly added windows with live_hidden_windows
When we add a window and it gets hidden as the first thing, we need
to show not just the frame window, but also the window itself.
Otherwise when the window subsequently becomes visible, it will
just be an empty frame.

Add helper functions to reduce current code duplication and avoid
adding more.

http://bugzilla.gnome.org/show_bug.cgi?id=586309
2009-06-19 11:40:42 -04:00
Davyd Madeley
f26d503694 Move meta_window_delete() to public API 2009-06-19 11:48:33 +08:00
Davyd Madeley
08c5095ad7 Add meta_window_get_transient_for() method 2009-06-17 09:40:55 +08:00
Davyd Madeley
dfb0e4f57b Add meta_window_get_title() method
Update meta_window_get_title() as per comments
2009-06-17 09:34:40 +08:00
Jon Nettleton
51a6467968 Comprehensively rename to Mutter
Code:
All references in the code not related to themes, keybindings, or
GConf were changed from 'metacity' to 'mutter'. This includes, among other
things, strings, comments, the atoms used in the message protocol, and
the envvars used for debugging. The GConf schema file was reduced to
the 3 settings new to mutter.

The overall version was brought up to 2.27 to match current gnome.

Structure:
All files named '*metacity*' were renamed '*mutter*' with appropriate
changes in the automake system.  Files removed are
doc/creating_themes, src/themes, doc/metacity-theme.dtd,
metacity.doap.  These files will eventually end up in an external
gnome-wm-data module.

Installation location:
On the filesystem the mutter-plugindir was change from
$(libdir)/metacity/plugins/clutter to just $(libdir)/mutter/plugins.
The mutter-plugins.pc.in reflects these changes.

Note:
mutter.desktop.in and mutter-wm.desktop both continue to have
X-GNOME-WMSettingsModule=metacity set.  This allows
gnome-control-center to continue using libmetacity.so for
configuration.  This is fine since most the general keybindings and wm
settings are being read from /apps/metacity/* in gconf.
2009-06-16 14:17:10 -04:00
Davyd Madeley
204431812b Move meta_window_{min,max}imize() to public API 2009-06-15 09:42:34 +08:00
Colin Walters
2ed1bf05d1 Add meta_window_get_wm_class
Public function to retrieve the cached WM_CLASS, used in gnome-shell
for tracking applications.
2009-05-29 13:26:18 -04:00
Vincent Untz
ea91834407 Remove metacity-dialog and always use zenity
This is a merge of metacity commits 0b3f45bb1b and 3d0bfbb4f4
2009-05-05 15:57:58 +02:00
Tomas Frydrych
90c35f8181 Allow the compositor to see ButtonPress events for buttons 4 or 5 2009-05-05 09:46:36 +01:00
Tomas Frydrych
2a8c160569 MetaScreen::keyboard-grabbed property
gboolean read-only property that tracks the all_keys_grabbed flag of
  MetaScreen.
2009-05-05 09:39:29 +01:00
Dan Winship
1d5117a607 Create a MetaAltTabHandler abstraction to allow alternate implementations
http://bugzilla.gnome.org/show_bug.cgi?id=580917
2009-05-04 10:25:58 -04:00
Dan Winship
99d0f41d98 Push the tab/workspace popup abstraction completely into screen.c
Also, use MetaWindows as the tab_popup keys rather than using (X) Windows
and then having to map back and forth everywhere, which is silly since
we never actually want the X Window.

http://bugzilla.gnome.org/show_bug.cgi?id=580917
2009-05-04 10:25:58 -04:00
Dan Winship
7b522c0de8 Split screen->tab_popup and screen->ws_popup
http://bugzilla.gnome.org/show_bug.cgi?id=580917
2009-05-04 10:25:58 -04:00
Dan Winship
cbf4be04fc Reorganize tab popup code a bit more cleanly.
Rather than trying to reverse-engineer what kind of tab/workspace
popup to create from within meta_display_begin_grab_op(), just create
the popup directly from do_choose_window()/handle_workspace_switch()
after completing the grab, since they already know which kind they
want.

Also add meta_screen_destroy_tab_popup()/_destroy_workspace_popup()
rather than having meta_display_end_grab_op() poke into MetaScreen's
internals itself.

http://bugzilla.gnome.org/show_bug.cgi?id=580917
2009-05-04 10:25:58 -04:00
Dan Winship
f55509aadd Fix some broken indentation and simplify nested if()s
http://bugzilla.gnome.org/show_bug.cgi?id=580917
2009-05-04 10:25:58 -04:00
Dan Winship
7e369d63b3 Remove some old compositor-related code that mutter doesn't need
http://bugzilla.gnome.org/show_bug.cgi?id=580917
2009-05-04 10:25:58 -04:00
Sander Dijkhuis
49400c08cd Export window maximize and unmaximize methods
http://bugzilla.gnome.org/show_bug.cgi?id=580434
2009-04-27 15:11:09 +02:00
Owen W. Taylor
76a3f9d402 Build and install introspection information
Build a XML gir file and binary typelib file for the interfaces that
we are installing for plugin use. They are installed into $(pkglibdir)
since they are private to the application.

http://bugzilla.gnome.org/show_bug.cgi?id=580041
2009-04-24 09:54:18 -04:00
Owen W. Taylor
52638b9d8e In case of GConf failure, fall back to local keybinding values
Always compile the default keybindings into Metacity, and if we
fail to retrieve the values from GConf, use the compiled-in
value. This makes things more robust especially in an environment
like JHBuild where GConf-schema-installation may not work
correctly.

Also use these values for the no-GConf case, rather than
having a separate arrray and code path.

http://bugzilla.gnome.org/show_bug.cgi?id=576127
2009-04-24 09:54:18 -04:00
Colin Walters
514d00698d Add support for a "meta key" which initiates extended WM operations
This patch adds the concept of a special key for WM operations, and
the default is Super_L, which on extended PC hardware is the
"Windows key".  What we do is handle the special case of a press
and release of this key (without any other intervening keys).

Super_L+<key> should still be passed to applications.  In the future
we may want to also take some of these keybindings (e.g. Super+TAB)
though.

http://bugzilla.gnome.org/show_bug.cgi?id=563047
2009-04-24 09:54:18 -04:00
Owen W. Taylor
c4a4de0056 Fix return transfer annotations for a number of functions and add docs
Add return transfer annotations (and while I was at it, docs), for
public functions that return MetaDisplay, MetaWindow, and MetaScreen.

http://bugzilla.gnome.org/show_bug.cgi?id=561297

http://bugzilla.gnome.org/show_bug.cgi?id=580027
2009-04-24 09:54:17 -04:00
Owen W. Taylor
28a4be2536 Add meta_workspace_set_builtin_struts()
Add a function to set a list of "built-in" struts for a workspace;
these are struts that are combined with the struts of the windows in
the workspace when determining the work area of the workspace.

http://bugzilla.gnome.org/show_bug.cgi?id=561297

http://bugzilla.gnome.org/show_bug.cgi?id=580026
2009-04-24 09:54:17 -04:00
Dan Winship
6e9803cd9f Add ::window-added and ::window-removed signals to MetaWorkspace
Add sigals to MetaWorkspace to allow tracking when windows are added
and removed. Note that on window creation that these signals are fired
before the window setup is totally complete, so they need to be used
with some care. (For example, the compositor, if present, has not
been notified of the new window.)

http://bugzilla.gnome.org/show_bug.cgi?id=580025
2009-04-24 09:54:17 -04:00
Owen W. Taylor
626912a9a4 Merge branch 'gnome-2-26' into master
Conflicts:
	configure.in
	src/core/schema-bindings.c
2009-04-08 16:11:12 -04:00
Tomas Frydrych
2e0cd7af5e Fixed focus handling in finish_minize().
When the window being hidden/mimimized has focus, is modal, but is not on the
  currently active workspace (e.g., during workspace switch before the new
  focus window is activated), we must prevent focus being passed to the modal
  window ancestor (otherwise the ancestor ends up being forcefully moved onto
  the active workspace).
2009-04-07 13:02:57 +01:00
Tomas Frydrych
8ccb9e04eb Postpone creation of the guard window until we are ready to manage windows.
Creating the gard window when constructing MetaScreen causes the screen to
  go black for the duration of Metacity startup which is uggly. We do not
  actually need that window until we are ready to manage windows on the screen.
2009-04-02 12:25:53 +01:00
Owen W. Taylor
8ab9ed5d4e Expose meta_window_get_icon_geometry()
Make meta_window_get_icon_geometry() public, so that it can be used
to from plugins to animate windows minimizing to the correct
position.

Based on a patch from Cosimo Cecchi <cosimoc@gnome.org>

http://bugzilla.gnome.org/show_bug.cgi?id=571109
2009-03-31 17:29:48 -04:00
Owen W. Taylor
4253ff8e12 Add a "toggle_recording" keybinding
Add a keybinding (defaulting to <Control><Shift><Alt>r) to record
a screencast of the session. This isn't hooked up to anything in
metacity itself, but a plugin can connect to a signal on MetaScreen.

keybindings.c all-keybindings.h: Add the keybinding
screen.c: Add a ::toggle-recording signal

http://bugzilla.gnome.org/show_bug.cgi?id=575290
2009-03-13 17:06:04 -04:00
Owen W. Taylor
fb7b820187 Cleanup: split MetaSide from MetaDirection
The MetaDirection enumeration had META_SIDE_* values in it that
were used in some places where an enum with only four directions
was needed. Split this off into a separate enum called MetaSide
and use that enum name where appropriate.
2009-03-17 16:53:01 -04:00
Dan Winship
a47bb96536 Add a MetaScreen:restacked signal and expose MetaWindow.layer
Expose restacking and a window's stack layer to allow a compositor
to insert elements into the window stack in the right location.
(See Bug 571827 – hide panel when screensaver is active)

src/core/stack.h src/include/common.h: Move MetaStackLayer to
 a public header.

src/core/screen.c src/core/screen-private.h src/core/stack.c:
 Add a ::restacked signal emitted after we finish restracking.

src/core/window.h src/include/window.h: Add meta_window_get_layer()
2009-03-12 17:07:27 -04:00
Dan Winship
0e256a21a5 Use GDestroyNotify instead of custom type, for better introspectability 2009-03-25 10:50:40 -04:00
Dan Winship
f78390b094 Notify the compositor of new windows slightly sooner.
In particular, make it so that we call meta_compositor_add_window() on
a new window before calling meta_compositor_sync_stack() to position
it. The list returned by mutter_plugin_get_windows() is only updated
by sync_stack(), but sync_stack() only pays attention to windows that
add_window() has already been called on. So without this change, a
newly-mapped window will not be returned by
mutter_plugin_get_windows() until after the *next* restacking.

http://bugzilla.openedhand.com/show_bug.cgi?id=1512
2009-03-18 15:09:15 -04:00
Tomas Frydrych
0b635aafae Make prototype for meta_window_find_root_ancestor() public. 2009-03-19 16:01:32 +00:00
Tomas Frydrych
31f48c0cf0 Removed unnecessary g_object_ref/unref() bracketing around g_object_notify(). 2009-03-17 12:28:00 +00:00
Tomas Frydrych
cd0ef08783 Added MetaWindow::fullscreen property (read only). 2009-03-17 12:27:13 +00:00
Tomas Frydrych
4203fd2993 Added MetaWorkspace::n-windows property (read-only). 2009-03-17 08:54:19 +00:00
Tomas Frydrych
54e56a47da Moved meta_window_get_outer_rect() prototype to window.h
Useful for plugins.
2009-03-17 08:35:17 +00:00
Tomas Frydrych
9a4d1d1375 Moved bunch of prototypes from display-private.h to display. 2009-03-12 14:48:22 +00:00
Dan Winship
616e140420 Ignore override-redirect windows when restacking based on window groups.
http://bugzilla.gnome.org/show_bug.cgi?id=571616 /
http://bugzilla.openedhand.com/show_bug.cgi?id=1461
2009-02-26 09:59:14 -05:00
Tomas Frydrych
39a3bb2c7d Sync up to upstream 2.25.144
Conflicts:

	configure.in
	src/core/main.c
	src/core/prefs.c
	src/core/window.c
	src/include/prefs.h
2009-02-12 17:14:12 +00:00
Tomas Frydrych
8c0ae7be83 Turned window decorated flag into MetaWindow::decorated property.
This allows things like the compositor to easily track decoration status.
2009-02-11 12:16:41 +00:00
Thomas James Alexander Thurman
b2da6d86f3 queue resize on window undecorate
* src/core/frame.c: queue resize on window undecorate


svn path=/trunk/; revision=4114
2009-02-05 01:06:15 +00:00
Thomas James Alexander Thurman
21416f453a Wrap g_error calls in braces.
* src/core/schema-bindings.c: Wrap g_error calls in braces.


svn path=/trunk/; revision=4110
2009-02-03 02:21:36 +00:00
Thomas James Alexander Thurman
e5db44ca90 Set prop_hooks_table to NULL after freeing it.
* src/core/window-props.c:


svn path=/trunk/; revision=4103
2009-02-01 20:47:33 +00:00
Thomas James Alexander Thurman
a203fb1037 Window properties are looked up in a hash table rather than
by iteration over an array.  Saves ~44us per window, but
        also makes the code cleaner.
	* src/core/display-private.h:
	* src/core/window-props.c:


svn path=/trunk/; revision=4097
2009-01-29 14:32:31 +00:00
Thomas James Alexander Thurman
8e6c0bec78 some lists failed to keep track of their contents and therefore didn't
* src/core/edge-resistance.c: some lists failed to keep track
          of their contents and therefore didn't free correctly.
          Closes #552303.


svn path=/trunk/; revision=4095
2009-01-28 02:30:30 +00:00
Thomas James Alexander Thurman
69ae9e4a9d Free name of old theme when new theme is loaded.
* src/core/prefs.c: Free name of old theme when new theme
          is loaded.


svn path=/trunk/; revision=4094
2009-01-28 02:08:09 +00:00
Thomas James Alexander Thurman
0a172cc053 Added a gconf key to swap the meanings of the right and
middle buttons when the modifier key is held down.
        Closes #437910.  Thanks to Matt Kraai for looking over
        the patch.
	* src/core/display.c:
	* src/core/prefs.c:
	* src/include/prefs.h:
	* src/metacity.schemas.in.in:


svn path=/trunk/; revision=4091
2009-01-27 21:05:42 +00:00
Thomas James Alexander Thurman
f5fa4a3866 All the window properties are now handled using simple
window property handlers.  Closes #549886.
	* src/core/window-private.h:
	* src/core/window-props.c:
	* src/core/window.c:


svn path=/trunk/; revision=4090
2009-01-27 05:03:06 +00:00
Thomas James Alexander Thurman
8cbcbb0655 More of the window properties are checked using simple
window property handlers.  The ones which remain don't
        actually look up the new value in the ordinary way, and
        so are a little trickier to merge.  Added an "initial"
        flag to be on the safe side that the behaviour is the
        same as before (so we don't do things when a window's
        first mapped that we only used to do when a property
        changed).  Partial fix for bug #549886.
	* src/core/window-props.c:
	* src/core/window-props.h:
	* src/core/window.c:


svn path=/trunk/; revision=4089
2009-01-27 03:53:07 +00:00
Thomas James Alexander Thurman
35d9d2864f add support for _NET_WM_MOVERESIZE_CANCEL.
* src/core/window.c: add support for _NET_WM_MOVERESIZE_CANCEL.


svn path=/trunk/; revision=4088
2009-01-25 22:59:50 +00:00
Tomas Frydrych
1d38209520 Fixed process_tab_grab()
When there is custom handler installed for the tab releavant tab function
  we do not want to actually call it form inside of this function, only to
  ensure that the grab is not released. The handler will get called in the
  normal way in process_event(). Whoever installed the handler (and requested
  the grab) also has to ensure the grab is released.
2009-02-03 17:30:49 +00:00
Tomas Frydrych
c1f3a5c67d Ensure that if custom handler is installed for one of the shortcuts that do
keyboard grab, the custom handler gets also called while the grab is in place.
2009-02-03 13:23:08 +00:00
Tomas Frydrych
6e543fbcfd Store the default keybinding handler alongside the custom one.
This allows us to fall back onto it if the custom handler removes itself.
2009-02-03 13:20:51 +00:00
Tomas Frydrych
9dee164790 Ensure that we do not attempt to free the tab popup when there is none. 2009-02-03 13:16:01 +00:00
Tomas Frydrych
b0cc2a8614 Handle gconf errors better for string values in preferences. 2009-02-03 10:15:23 +00:00
Dan Winship
f4ecc9bab8 Make compositor private a GObject than a void pointer
Requiring the compositor private object to be a GObject allows the
return value of meta_window_get_compositor_private() to be used
via gobject-introspection, since the type and memory management
can be determined.

This allows a reverse mapping from MetaWindow to MutterWindow.

- Change meta_window_get/set_compositor_private to use GObject
  rather than void *
- Adapt code in compositor-mutter.c to match.
2009-02-02 15:16:05 -05:00
Tomas Frydrych
c3884e9900 Can't g_free() MetaDisplay GObject. 2009-02-03 09:11:32 +00:00
Tomas Frydrych
39c88facc5 Move meta_display_get_tab_*() functions into display.h 2009-02-02 17:01:27 +00:00
Tomas Frydrych
6b1aa3cf04 Do not allocate the tab_pop up object at all when the --no-tab-popup option is set
This option is intended primarily so that and Alt+Tab implementation can be
  provided in a plugin, so having the object around makes no sense.
2009-02-02 15:28:26 +00:00
Tomas Frydrych
2e1893f7d3 --no-tab-popup && no-tab-popup gconf key
Disables the use of popup (and highlight frame) for window cycling.
2009-02-02 14:09:04 +00:00
Tomas Frydrych
d1fd844bc4 MetaWindow::raised signal. 2009-02-02 14:08:46 +00:00
Tomas Frydrych
db273ce50c MetaWindow::focus signal. 2009-02-02 11:00:13 +00:00
Tomas Frydrych
2338611046 meta_keybindings_switch_window()
Public function to switch to the next window in Alt+Tab like fashion.
2009-01-29 16:26:12 +00:00
Tomas Frydrych
7d3a05f2d1 Removed const qualifier from key_handlers[] so we can modify it; use find_handler() in meta_keybindings_set_custom_handler(). 2009-01-29 15:29:43 +00:00
Tomas Frydrych
952d63a127 Implemented meta_keybindings_set_custom_handler(). 2009-01-29 15:07:57 +00:00
Tomas Frydrych
23bed522ab Expose keybindings data types; add user_data parameter the handler signature. 2009-01-29 14:53:03 +00:00
Tomas Frydrych
813acae961 Rename keybindings.h to keybindings-private.h 2009-01-29 14:16:01 +00:00
Tomas Frydrych
a96939be0f MetaWindow::workspace-changed signal.
Emitted when window is moved from one workspace to another; the number of the
  old workspace is passed to the signal handlers.
2009-01-20 12:52:06 +00:00
Tomas Frydrych
cb3870f9f6 Sanity check to ensure we do not try to relocate windows onto NULL workspace. 2009-01-20 12:48:59 +00:00
Tomas Frydrych
25d628aea2 Exposed MetaGroup API. 2009-01-15 15:37:48 +00:00
Tomas Frydrych
aad8eb1999 Added meta_group_get_size() to allow for more efficient check of whether window is part of a larger group. 2009-01-15 15:21:43 +00:00
Tomas Frydrych
fc6b78a20c Ensure that meta_compositor_map_window() is even when we only get MapNotify. 2009-01-12 16:41:06 +00:00
Tomas Frydrych
ec0562550a Added meta_window_get_role(). 2009-01-12 12:30:31 +00:00
Tomas Frydrych
95fa3a3879 Ensure that when a workspace is removed from the middle of the list, the
_NET_WM_DESKTOP props on windows on following workspaces are correctly set.
2009-01-09 15:04:53 +00:00
Frederic Peters
b66fbc0369 added call to g_thread_init(), as ORBit2 stopped doing it and Metacity is
* src/core/main.c: (main): added call to g_thread_init(), as ORBit2
stopped doing it and Metacity is using gconf; closes #565517.


svn path=/trunk/; revision=4063
2008-12-25 13:06:00 +00:00
Thomas James Alexander Thurman
01027006a7 windows which attempt to present themselves but are offscreen end up
* src/core/window.c: windows which attempt to present themselves
          but are offscreen end up demanding attention, unless they
          are transient, when they move to the current workspace
          as before.  Closes #482354.


svn path=/trunk/; revision=4060
2008-12-21 05:35:30 +00:00
Thomas James Alexander Thurman
45f2ec5f64 patches to fixes for -Wall. Closes #562939.
* src/core/iconcache.c: patches to fixes for -Wall.  Closes #562939.


svn path=/trunk/; revision=4049
2008-12-02 08:15:00 +00:00
Thomas James Alexander Thurman
3b1e91342e gnome-doc-tools version doesn't need to be so high. disable the entire
* configure.in: gnome-doc-tools version doesn't need to be so high.
	* src/compositor/compositor-xrender.c: disable the entire file if the
          compositor is disabled.
	* src/core/async-getprop.[ch]: fixes for -Wall
	* src/core/iconcache.c: fixes for -Wall
	* src/core/testasyncgetprop.c: fixes for -Wall
	* src/core/xprops.c: fixes for -Wall


svn path=/trunk/; revision=4045
2008-12-01 22:54:57 +00:00
Thomas James Alexander Thurman
cf2206352f add casts (#562106)
* src/core/xprops.c: add casts (#562106)


svn path=/trunk/; revision=4038
2008-11-25 23:18:08 +00:00
Thomas James Alexander Thurman
41b6f0803e remove apparently spurious warnings about operations on window "none"
* src/core/display.c: remove apparently spurious warnings about
	operations on window "none"


svn path=/trunk/; revision=4026
2008-11-23 18:53:55 +00:00
Thomas James Alexander Thurman
c2abbce2ed fix stupid infinite loop when GConf is turned off.
* src/core/prefs.c: fix stupid infinite loop when GConf is turned off.


svn path=/trunk/; revision=4024
2008-11-22 19:34:03 +00:00
Thomas James Alexander Thurman
38cd6a6c1f fix two places where there was a warning if GConf was turned off.
* src/core/prefs.c: fix two places where there was a warning
	if GConf was turned off.


svn path=/trunk/; revision=4023
2008-11-22 19:10:50 +00:00
Thomas Thurman
ac365b4ead (Apologies for huge commit; these were done on a transatlantic flight. This is why we need bzr.)
2008-11-22  Thomas Thurman  <tthurman@gnome.org>

        * src/core/all-keybindings.h: "backward", not "backwards" throughout.

2008-11-20  Thomas Thurman  <tthurman@gnome.org>

        * configure.in: turned on -Wall and -Werror in order to
          trap as many problems as possible.
        * src/ui/resizepopup.c: added correct #include.
        * src/ui/theme-viewer.c: initialised variable.
        * src/core/xprops.c: corrected cast.
        * src/core/main.c: added warning if chdir() fails.
        * src/core/schema-bindings.c: checking the return
          result of fgets().

2008-11-20  Thomas Thurman  <tthurman@gnome.org>

        Merged screen and window keybinding tables so that
        we can use just one file for the both.  Also incidentally
        closes #528337.  Further efficiencies of scale to come.

        * src/include/prefs.h: replace META_PREF_*_KEYBINDINGS
          with META_PREF_KEYBINDINGS
        * src/core/keybindings.c: replace *_bindings with key_bindings
          and similar throughout; all window-based functions are now
          guaranteed to receive a window so don't need to check for
          themselves
          (find_handler): moved so it can also be called from
                          rebuild_binding_table
        * src/core/display-private.h: replace *_bindings with key_bindings
        * src/core/prefs.c: update_*_binding becomes update_key_binding;
          (change_notify): tidy up references to "enormous if statement"
                           since it's almost entirely gone now
        * src/core/all-keybindings.h: new merged version of
                           screen-bindings.h and window-bindings.h.


svn path=/trunk/; revision=4022
2008-11-22 19:02:54 +00:00
Owen W. Taylor
e083742426 Filter out events handled before the plugin before they get GTK+
Fix a problem where GTK+ was warning
'gdk_window_set_user_time called on non-toplevel' for every button
press and click on the mutter stage by excluding such events from
GTK+ processing.

Add a boolean return value to meta_compositor_process_event that
indicates whether the event has been handled and should be filtered
out of the event stream and for mutter, base that on the return
value of the plugin's xevent_filter vfunc.
2008-11-22 13:07:32 -05:00
Thomas James Alexander Thurman
a06d96316e This change adds support for the new _NET_WM_FULLSCREEN_MONITORS
property and client message.  This allows client applications to request
 	that a fullscreen window cover more than one monitor.
 	* src/include/boxes.h:
	* src/core/boxes.c: Add meta_rectangle_union
 	* src/core/window-private.h:
	* src/core/window.c:
 	(meta_window_new_with_attrs, meta_window_free, set_net_wm_state,
 	meta_window_update_fullscreen_monitors, meta_window_client_message): Add
 	MetaWindow property to store fullscreen monitors field, update
 	_NET_WM_FULLSCREEN_MONITORS property on windows, and handle client
 	message.
 	* src/core/atomnames.h: Add _NET_WM_FULLSCREEN_MONITORS atom.
 	* src/core/constraints.c (setup_constraint_info): If
 	_NET_WM_FULLSCREEN_MONITORS is interesting, use the data stored in
 	MetaWindow::fullscreen_monitors to determine the fullscreen area instead
 	of the basic xinerama_info area.


svn path=/trunk/; revision=4021
2008-11-17 02:57:20 +00:00
Thomas James Alexander Thurman
8524f510c6 Removed deprecated calls. Closes #560445.
* src/core/delete.c: remove deprecated g_strcasecmp.
	* src/include/main.h: no actual deprecated call, but
	  a mention of one which was out of date.


svn path=/trunk/; revision=4018
2008-11-12 03:56:01 +00:00
Thomas James Alexander Thurman
39e389cc5b Clean up #includes according to the GNOME Goal.
Closes #560449.  Patch is 122467.
	* src/core/place.c:
	* src/ui/draw-workspace.h:
	* src/ui/gradient.h:
	* src/ui/metaaccellabel.c:
	* src/ui/metaaccellabel.h:
	* src/ui/preview-widget.c:
	* src/ui/preview-widget.h:
	* src/ui/resizepopup.c:
	* src/ui/theme.c:
	* src/ui/theme.h:
	* src/ui/themewidget.h:


svn path=/trunk/; revision=4017
2008-11-12 03:43:51 +00:00
Thomas James Alexander Thurman
c4768a3b9f added dependency on Zenity remove error_on_generic_command() and
* configure.in: added dependency on Zenity
	* src/core/keybindings.c: remove error_on_generic_command() and
	  error_on_terminal_command(); rewrite error_on_command
	  in terms of meta_show_dialog()
	* src/core/util.c: add meta_show_dialog() to call Zenity
	* src/include/util.h: ditto


svn path=/trunk/; revision=4013
2008-11-08 18:51:56 +00:00
Tomas Frydrych
b7466365a1 Removed unused variable. 2008-12-18 12:46:39 +00:00
Tomas Frydrych
3b3226b678 Merge branch 'plugin-gobject' into next-generation
Conflicts:

	src/compositor/mutter/compositor-mutter.c
	src/core/window.c
2008-12-18 12:41:56 +00:00
Tomas Frydrych
0214ece238 Merge commit 'clutter/override-redirect-core-1' into next-generation 2008-12-18 12:28:01 +00:00
Tomas Frydrych
a6d04255a8 Fixed bunch of warnings. 2008-12-18 11:05:17 +00:00
Tomas Frydrych
9821453b5f Merge branch 'upstream-2.25.55' into next-generation
Conflicts:

	configure.in
	src/Makefile.am
	src/core/screen-bindings.h
	src/metacity.schemas.in
2008-12-18 11:00:19 +00:00
Colin Walters
57a2d20d61 Add gproperties to MetaWindow: "title", "icon", "mini-icon"
We need these properties to do things outside of the frame, without
dropping to libwnck.

http://bugzilla.gnome.org/show_bug.cgi?id=563405
2008-12-05 20:03:27 -05:00
Colin Walters
8c3bcc7229 Make MetaDisplay a real GObject
We need this to be able to add signals, among other things.

http://bugzilla.gnome.org/show_bug.cgi?id=563047
2008-12-02 17:58:07 -05:00
Robert Bragg
f956853550 No longer handle ConfigureNotify events directly in mutter
We are now informed of window moves/resizes via callbacks from
src/core instead.
2008-11-27 13:40:52 +00:00
Robert Bragg
6849735e9d Adds support in src/core for tracking override redirect windows.
The metacity core is now directly aware of override redirect windows.
- They get MetaWindows like normal windows, so mutter no longer need to special
  case them. The net wm types applicable to override redirects are also
  recognised.
- The original positioning/stacking semantics of metacity with respect to OR
  windows are maintained, but now it's easier to synchronize the stacking
  between the core and mutter.
- mutter no longer needs to manualy track UnmapNotify, MapNotify,
  ReparentNotify, CreateNotify and DestroyNotify events; instead map, unmap,
  add and remove events can now be consistently delivered via the
  MetaCompositor callbacks.
2008-11-23 19:28:40 +00:00
Owen W. Taylor
06817df975 Add a 'n-workspaces' property to MetaScreen
Add a 'n-workspaces' property to MetaScreen to allow for notification
when the number of workspaces changes.

http://bugzilla.gnome.org/show_bug.cgi?id=561297
2008-11-17 17:22:28 -05:00
Owen W. Taylor
98ccfea388 Make MetaScreen and MetaWorkspace GObjects
src/core/screen.c src/core/screen-private.h src/include/screen.h:
Make MetaScreen a GObject.

src/core/workspace.c src/core/workspace-private.h src/include/workspace.h:
Make MetaWorkspace a GObject. Rename meta_workspace_free() to
meta_workspace_remove().

http://bugzilla.gnome.org/show_bug.cgi?id=561297
2008-11-17 15:56:34 -05:00
Owen W. Taylor
9a1be03205 Make MetaWindow a GObject
Make MetaWindow into a GObject so that it is accessible to
gobject-introspection (also allows for signals to be added.)

Renames:

 meta_window_free() => meta_window_unmanage()
 meta_window_get_type() => meta_window_get_window_type()
 meta_window_get_type_atom() => meta_window_get_window_type_atom()
2008-11-07 04:57:00 -05:00
Tomas Frydrych
026008a700 Fix to allow windows created from within Mutter itself to be managed. 2008-12-02 12:11:06 +00:00
Owen W. Taylor
b26fc771b1 Drain the clutter event queue
When multiple events are generated from a single event (for example,
when a motion event generates an enter/leave pair), events accumulate
in the clutter event queue if the clutter event source is not running.
Add a simple event source that checks clutter_events_pending() and
dispatches events as necessary.
2008-11-05 17:49:55 -05:00
Tomas Frydrych
04619df818 Added timestamp parameter to meta_window_change_workspace_by_index(). 2008-11-25 15:34:07 +00:00
Tomas Frydrych
c1928ead7c Exposed meta_display_get_current_time/_roundtrip(). 2008-11-25 15:24:48 +00:00
Tomas Frydrych
b43f9aec5a Fixed clutter-less build. 2008-11-25 12:26:26 +00:00