1
0
Fork 0
Commit graph

386 commits

Author SHA1 Message Date
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
Tomas Frydrych
99f6b2cdce meta_screen_get_active_workspace() 2008-11-20 12:41:28 +00:00
Tomas Frydrych
da55d8e738 meta_window_change_workspace_by_index() 2008-11-20 09:14:58 +00:00
Tomas Frydrych
40c25dc426 Exposed meta_window_get_startup_id () 2008-11-19 12:30:45 +00:00
Robert Bragg
3211fb04d3 Merge branch 'fix-stacking' into clutter 2008-11-04 15:26:17 +00:00