1
0
Fork 0
Commit graph

1891 commits

Author SHA1 Message Date
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
f03d39eefb Check the opacity of the right actor
When determining if the window is opaque or not, look at it's opacity,
not the opacity of the window group.

Reported by Matthias Clasen
http://bugzilla.gnome.org/show_bug.cgi?id=591836
2009-08-14 15:58:07 -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
Michael Meeks
16466cf7d6 install errors.h header, bug 591566 2009-08-13 09:46:15 +01: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
Tomas Frydrych
2c8df7d12e Do not run effects during WM startup
When we first start up, we do not want to run effects on any pre-exising
windows (this is either the case we are starting up and there are no windows,
or we are replacing an exisint window manager, or worse, we crashed, and we
just want to get to the desired desktop as quick as possible).

Dithered about where to place the check; putting into the plugin manager
reduces the number of places (and files) in which it needs to be done.
2009-08-12 07:45:03 +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
Tomas Frydrych
bca3eaf709 Removed custom 'GIR' label for gir generation in silent-rules mode
http://bugzilla.gnome.org/show_bug.cgi?id=591120
2009-08-08 13:47:31 +01:00
Tomas Frydrych
0f64202a29 Added --enable-silent-rules if automake-1.11 is available 2009-08-07 17:58:02 +01:00
Tomas Frydrych
6b36e64e00 Take extra reference on the texture inside MutterWindow
We store a pointer to the texture independently of the ClutterContainer
internals, and rely on the pointer remaining valid until we run dispose.
Since we also provide public API to access this pointer, we should not
rely on the reference ClutterContainer holds to ensure that texture will
not be destroyed (e.g., some nasty developer could reparent the texture).
2009-08-07 17:38:11 +01:00
Tomas Frydrych
84059f1faa Free MutterWindow description string in finalize() not dispose()
We were freeing the description string in dispose and not setting it to NULL,
thus leaving around a dangling pointer for the duration of the disposal.
This commit moves the free into the finalize vfuction, where it belongs.
2009-08-07 16:47:43 +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
Tomas Frydrych
ff9400abde Remove deprecated GTK symbols
http://bugzilla.gnome.org/show_bug.cgi?id=587991

(adapted from metacity commit 3f76affbd2,
original patch by Thomas Andersen)
2009-08-04 09:23:37 +01:00
Tomas Frydrych
e985bf0e7a use g_signal_handlers_disconnect_by_func instead of an old deprecated
http://bugzilla.gnome.org/show_bug.cgi?id=587991

(adapted from metacity commit a8f8970601,
original patch by Matt Kraai)
2009-08-04 09:22:49 +01:00
Tomas Frydrych
245908909b Fix check for zero-sized textures in MutterShaped texture
Patch by Jon Nettleton <jon.nettleton@gmail.com>

http://bugzilla.openedhand.com/show_bug.cgi?id=1538
http://bugzilla.gnome.org/show_bug.cgi?id=590646
2009-08-04 08:47:46 +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
Thomas Wood
1f90529365 Don't explicitly set the size of the MutterWindow texture
Setting the size of the texture causes the minimum and preferred width and
height values to be fixed at the set value. The normal requisition functions
of ClutterTexture will already report the size of the texture pixmap as the
natural size, but also allow scaling down as needed if less space is
available. We don't need that here, but we want to allow someone to make
a ClutterClone of the texture actor.
2009-07-31 13:36:59 +01:00
Colin Walters
a1ac1f4b2e Build using Clutter 1.0
Clutter just released 1.0, sync to that.
2009-07-29 12:08:53 -04:00
Owen W. Taylor
d91d503eb2 Pass event to clutter when the plugin doesn't have xevent_filter
With recent changes, Clutter no longer sets up the viewport correctly,
unless it receives ConfigureNotify events. If there is a plugin with
an xevent_filter function, then it's that plugins responsibility to pass
the event to Clutter if it doesn't want it. If there is no plugin,
or the plugin doesn't have an xevent_filter function, then we should
call clutter_x11_handle_event() ourselves.

http://bugzilla.gnome.org/show_bug.cgi?id=589419
2009-07-28 16:00:24 -04:00
Owen W. Taylor
e84bf7144c Queue redraws on MutterWindow's MutterShapedTexture
When a windows contents or shape changes, we schedule a redraw
with clutter_actor_queue_redraw(); we need to queue the redraw
on the shaped texture rather than on the window actor to support
cloning of just the shaped texture without the shadow: that
is, the shaped is what is really changing and it may be
visible via a clone even if the MutterWindow itself is not
visible.

http://bugzilla.gnome.org/show_bug.cgi?id=589429
2009-07-28 15:50:28 -04:00
Owen W. Taylor
ec2c197e1f Fix confusion about MetaPreview in introspection build
MetaPreview is only built into libmutter-private, and not included in
the mutter executable. Linking mutter against libmutter-private was
inadvertently added when the introspection build process was set up,
but isn't actually needed, and if -Wl,-as-needed is added during the
build process, then the libmutter-private dependency will be skipped.

* Don't link mutter (or the test programs) against libmutter-private

* Exclude meta-preview.h from the set of headers we feed into the
  introspection build process

Reported by Patryk Zawadzki

http://bugzilla.gnome.org/show_bug.cgi?id=587975
2009-07-17 07:56:19 -04:00
Owen W. Taylor
65565a96b7 Fix 'make distcheck'
* Make generation of the .gir file work for srcdir != builddir
* Add files to CLEANFILES as needed
* Don't distribute the generated file mutter.schemas
2009-07-16 17:54:56 -04:00
Owen W. Taylor
83f8bfd2ca Reduce overpaint in the window group
When we are painting a stack of 5-10 maximized windows, the
standard bottom-to-top method of drawing every actor results
in a tremendous amount of overdraw and can easily max out
the available memory bandwidth on a low-end* graphics chipset.
It's even worse if window textures are being accessed over
the AGP bus.

When we have opaque windows, we can go ahead and compute visibility
ourselves (in classic X-server fashion) and use that information to
restrict drawing obscured actors.

* Add MutterWindowGroup - a ClutterGroup subclass with logic
  for figuring out obscured regions.

* Add mutter_window_get_obscured_region() to get the region
  obscured by that window.

* Add mutter_shaped_texture_set_clip_region() to hint
  a clip region to the painting code; this is set based on
  the computed visible region of MutterWindowGroup.

* Add tidy_texture_frame_set_needs_paint() to hint that the
  paint can be skipped entirely; this is used when we detect
  that the window shadow is entirely obscured.

http://bugzilla.gnome.org/show_bug.cgi?id=587344
2009-07-09 16:56:01 +01:00
Colin Walters
a454ad5c41 Promote include/main.h to public headers
Want to be able to Meta.quit() from bindings.
2009-07-08 17:25:54 -04:00
Owen W. Taylor
4be8e155d1 Fix crash when starting not on first workspace
If we are starting on something other than the first workspace,
meta_compositor_switch_workspace() will be called before
meta_compositor_manage_screen(); guard against that.
2009-07-06 08:43:07 +01: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
cd048be932 Remove unused focus_window member of MetaCompScreen
Remove some old code; the compositor no longer tracks
the focus window.

http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-07-06 00:06:23 +01:00
Owen W. Taylor
5d477c4b4e Remove include_destroy parameter to mutter_window_effect_in_progress()
Clean up mutter_window_effect_in_progress() by removing the
include_destroy parameter which was used only in one place that
could be easily done otherwise. (There was another use in
mutter_window_sync_actor_position() that had no point and looked
unintended.)

http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-07-06 00:04:58 +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
Owen W. Taylor
309a07bf4c Remove unused dock_windows list from MetaCompScreen
MetaCompScreen.dock_windows was kept updated, but never used.

http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-07-05 23:56:58 +01:00
Owen W. Taylor
a0f06cab43 Fix function names in debug tracing statements
Refer to meta_compositor_* not the old clutter_cmp_* names.

http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-07-05 23:56:55 +01:00
Owen W. Taylor
1d65e2e50c Reindent and reorganize compositor.h
Reindent compositor.h in a more consistent fashion, and group
logically related functions together.

http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-07-05 23:56:55 +01:00
Owen W. Taylor
c60d4c2bc4 Separate source and header files for MutterWindow
compositor.c: Move MutterWindow code to mutter-window.c;
 rename map_win() to mutter_window_map(), etc.

mutter-window-private.h: New private header file for
 MutterWindow functions used internally to the compositor.

compositor-mutter.h: Move MutterWindow declarations to
 mutter-window.h; move a couple of private functions to
 compositor-private.h

compositor-private.h: Move MetaCompScreen declaration to here:
 Conceptually it's private to compositor.c, but MutterWindow
 manipulates some of the lists directly for now.

mutter-plugin.c compositor.c: Don't call mutter_window_effect_completed()
 for MUTTER_PLUGIN_SWITCH_WORKSPACE, but use a new
 mutter_switch_workspace_completed(), since the window is
 just used to identify a screen.

http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-07-05 23:56:51 +01:00
Owen W. Taylor
f0d22e18c4 Split shadow code into a separate file
Separate code related to creating the gaussian-blurred shadow texture
into a separate file.

Move the definition of MetaCompositor into a compositor-private.h
so that the shadow code can cache the source in the compositor
structure.

http://bugzilla.gnome.org/show_bug.cgi?id=587251
2009-07-05 23:28:38 +01:00
William Jon McCann
9d36e8d853 Add bits missing from last commit
Try to reconstruct the marshal list and enum type templates and
add templates to extra dist list.
2009-07-04 17:14:48 +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
72149a054e Make MetaCompositor the clutter compositor
* Move compositor-mutter.c to compositor.c

* Remove the 'Mutter' typedef and define the structure for
  MetaCompositor directly.

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
455486db7c Avoid restacking animating hidden actors
Since the stack passed to the compositor now accurately reflects
the X stacking order, we need to treat hidden windows (which are
at the bottom of the X stacking order) specially - when the
compositor stacking order is synced, try to keep animating hidden
actors in their old positions in the stack.

http://bugzilla.gnome.org/show_bug.cgi?id=585984
2009-06-30 09:33:29 -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
072ec184d3 Revert "Unparent rather than destroy MutterWindows."
This reverts commit 16d49695ad.

If we want an actor to go away deterministically, we should call
clutter_actor_destroy(); using unparent instead a) may result
leaks through cyclic ref counts, and b) will delay the deallocation
of the window texture in a garbage collected environment until
the next garbage collection, causing much greater transient use
of memory.

http://bugzilla.gnome.org/show_bug.cgi?id=580520
2009-06-23 14:13:59 -04:00
Davyd Madeley
321b40a386 Fix broken MUTTER_PLUGIN_TYPE -> MUTTER_TYPE_PLUGIN 2009-06-22 10:38:09 +08:00
Marina Zhurakhinskaya
0a863b8c2b Handle input area set to full screen or reset during start-up
info->pending_input_region needed to be destroyed in
mutter_set_stage_input_region() before it was set to something
else or before it was reset to be full screen (region == None).

Set the initial input area to an empty region by
setting info->pending_input_region to an empty region by default
and setting it to None or a new region if a new input region is
specified.

Remove show_overlay_window() function that was used to set an empty
input region on start-up, and uses a call to do_set_stage_input_region()
with info->pending_input_region as an argument instead.
2009-06-19 16:48:44 -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
Davyd Madeley
29257f107a IS_MUTTER_PLUGIN() -> MUTTER_IS_PLUGIN()
IS_MUTTER_PLUGIN never actually worked. So it's not going to break anyone's
API to fix the namespace while making the macro work.
2009-06-17 09:34:06 +08:00
Florian Muellner
ecde490967 Suppress strict aliasing warning
Fix a (harmless) warning about strict aliasing that some GCC versions
give when using g_module_symbol().

http://bugzilla.gnome.org/show_bug.cgi?id=582243
2009-06-16 15:47:59 -04: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
Owen W. Taylor
627b4484ec Fix _XOPEN_SOURCE compilation problems on Solaris
Change #define _XOPEN_SOURCE 500 to 600 in compositor-xrender.c to
avoid a bad interaction with -xc99 on Solaris.

Remove unneeded #define in compositor-mutter.c.

Based on a patch by Brian Cameron

http://bugzilla.gnome.org/show_bug.cgi?id=580662
2009-06-12 14:50:15 -04:00
Owen W. Taylor
442991a712 Adapt to premultiplied alpha usage in Cogl
Cogl's default blend function has been switched to expect premultiplied
alpha. Change the combine function and the colors we use to
modulate alpha to match.

http://bugzilla.gnome.org/show_bug.cgi?id=585480
2009-06-11 15:36:27 -04:00
Owen W. Taylor
7eae5d4eab Allow slicing the mask texture
It doesn't make sense to allow the window texture to be sliced,
but not allow the mask texture to be sliced. So, we should either
set 'disable-slicing' for the texture actor or not pass NO_SLICING when
creating the mask texture.

While slicing currently results in only the first layer being shown,
disabling slicing entirely would break windows larger than the texture
size limit.  It would be straightforward to support multitexturing of
sliced textures in Cogl when all the textures are identically sized
and sliced identically, if it became a priority.

http://bugzilla.gnome.org/show_bug.cgi?id=585151
2009-06-11 14:49:59 -04:00
Davyd Madeley
f3914c86b9 s/META_WINDOW_TYPE/META_TYPE_WINDOW/ in META_IS_WINDOW() 2009-06-10 12:43:43 +08:00
Owen W. Taylor
fafb752827 Port to Mutter to Clutter 1.0 API
- Use float instead of ClutterUnit
- clutter_actor_get_size/position() return floats (remove some
  stray usage of these functions in the default plugin as well.)
- Adapt to cogl_texture_new_from_data() changes
- Use blend strings to set up multitexturing
- Remove CLUTTER_UNITS_TO_FLOAT() usage

http://bugzilla.gnome.org/show_bug.cgi?id=585016
2009-06-08 09:34:09 -04: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
Owen W. Taylor
9883f6e679 Select for crossing events on stage and overlay
If the input region has been shaped, then clutter needs to
receive EnterNotify/LeaveNotify events in order to properly
send enter and leave events to actors when the pointer crosses
the boundary of the stage.

http://bugzilla.gnome.org/show_bug.cgi?id=578250
2009-05-05 13:57:23 -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
Owen W. Taylor
6cf71a06c0 Remove debug printf about opacity
Don't print ""setting opacity to %d\n" every time a window's opacity
changes.

http://bugzilla.gnome.org/show_bug.cgi?id=580655
2009-04-29 11:44:15 -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
7a7632fa98 Allow setting input region before output window is created
If mutter_plugin_set_stage_input_region() and related methods are
called before the output window is available, save the set input
region and apply it to the output window later on.

compository-mutter.[ch]: Add mutter_set_stage_input_region() and
mutter_empty_stage_input_region(), move the input region handling
here and implement the delayed shape setting described
above.

mutter-plugin.c: Implement shape setting in terms of the new methods.

http://bugzilla.gnome.org/show_bug.cgi?id=580042
2009-04-24 09:54:19 -04:00