The return value of XGrabKeyboard() wasn't actually being assigned
to the 'result' variable so we didn't notice when grabbing the
keyboard failed.
https://bugzilla.gnome.org/show_bug.cgi?id=596343
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
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.
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.
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).
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.
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.
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
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
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
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.
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
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
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
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
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
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
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
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
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
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
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.
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.
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
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
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
- 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
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
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
Using G_MODULE_BIND_LOCAL causes problems for introspecting plugins,
since introspected symbols need to be globally available. And in
any case, trying to use linker features to prevent symbol conflicts
doesn't usually work out very well, it's better to just namespace
properly.
http://bugzilla.gnome.org/show_bug.cgi?id=580033
Add separate mutter_plugin_manager_load() and
mutter_plugin_manager_initialize() calls so that we can just
load the plugins without start them. This is useful for introspecting
a gnome-shell plugin at build time.
http://bugzilla.gnome.org/show_bug.cgi?id=580032
To guard against CompositeNameWindowPixmap failing, just use an
error trap. Previous code used:
GrabServer/GetWindowAttributes/CompositeNameWindowPixmap/UngrabServer
To prevent BadMatch errors from !viewable, but didn't check the
return value of GetWindowAttributes and didn't check if an error
occured during the error trap. This way is more correct and more
efficient.
http://bugzilla.gnome.org/show_bug.cgi?id=580023
The overlay window was created before the plugins are loaded. Because the
composite extension immediately maps the window, we ended blanking the screen
while plugins, etc., were loading. This commit reorganizes the code so that
the overlay window is only created just before we are ready to show the
stage.
The significant impact of this change is that plugins cannot manipulate the
overlay window during their initial loading, i.e., they cannot call the
input-region API (the plugin should hook into the "show" signal if it needs
to do anything of this sort).
The commit also removes the XClearArea() call on the overlay window that
seems to have served no real purpose.
Once the window destruction is initiated, we can still manipulate our
MutterWindow with clutter API, but we can not longer use any X-based API,
or MetaWindow API to query it.
Add 'hide_after_effect' flag to MutterWindowPrivate, tracking
whether the window needs to be hidden after all outstanding effects
finish.
Set or clear the flag as appropriate in clutter_cmp_set_window_hidden.
In mutter_window_effect_completed, if hide_after_effect is TRUE
and no other effects are in progress, hide the window.
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.
Now that Cogl has the material API we can use Cogl calls for
multi-texturing instead of directly calling GL.
The MutterShapedTexture actor keeps a handle to a material with the
right combine modes for combining the texture and the shape
mask. Before each paint it sets the layers of the material to be the
two textures.
A second material with different combine modes 1is also created if the
pixmap is 24 bit to implement the workaround from commit 72da8c57.
It seems that with the latest intel drivers when multi-texturing using an RGB
TFP texture, the texture is being setup internally as an RGBA texture, where
the alpha channel is mostly 0.0 so you only see a shimmer of the window. This
workaround forcibly defines the alpha channel as 1.0. Maybe there is some
clutter/cogl state that is interacting with this that is being overlooked,
but for now this seems to work. (Tested on i945 + DRI2)
The addition of method implementations in the base class in the
plugin-gobject branch broke the logic for checking to see
if a plugin didn't implement an effect. Requiring a mandatory
chain up to the base class is a fiddly anyways, so this patch
does the 'running' count computations in a different (and more
robust) way.
mutter-plugin.h mutter-plugin.c: Add _mutter_plugin_effect_started()
to increment the running count.
mutter-plugin-manager.c: Call _mutter_plugin_effect_started()
as necessary.
mutter-plugin.c: Remove the "real" methods that did nothing
but implement the runnning count.
plugins/default.c: Remove chain-ups.
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.
Before we've retrieved a pixmap for a window, the shaped texture
has a 0x0 texture, which will cause mutter_shaped_texture_ensure_mask()
to crash. Just skip all of paint/pick in this case.
http://bugzilla.openedhand.com/show_bug.cgi?id=1283
Add (transfer none) annotations to mutter_window_get_texture()
and mutter_window_get_meta_window(), and while add doc comments,
actually add some docs as well.
Since this is the most common cause of performance issues, this makes it
clearer when GLX TFP isn't being used. Note, there was a corresponding
fix to clutter_glx_texture_pixmap_using_extension() committed last week
as r3559 in the 0.8 branch.
* 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
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.
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()
It's more awkward and error prone, considering plugin ininteractions, to simply
show/hide the actors of hidden windows, and it seems to be more reliable to
reparent them to a hidden group instead.
We can't easily use a metacity layer to hide windows as that means we
loose our original stacking position. (Metacity's stack positions are
only valid within a single layer) We now have a "guard window" per
screen that is a fullscreen override redirect that is lowered to the
bottom of the stack. Hidden windows now remain in their original layer
so the stacking position remains valid, but all hidden windows get
XRestacked under the guard window.
A new compositor hook is also added to inform it when a window becomes
hidden/unhidded, this lets us map/unmap the corresponding actor.
missing files in preview commit (TODO: rebase -i and squash this later)
Calling clutter_actor_show_all() on the stage and overlay_group breaks
the ability for plugins to create initially hidden actors. Call
clutter_actor_show() instead.
If a mutter plugin name (in GConf, or more likely on the command line)
looks like an absolute path, use that path directly rather than
looking for the plugin in the plugins directory.
Remove a "got here" leftover, remove unnecessary trailing \n when
calling g_message(), include g_module_error() in the output when
loading a module fails.
If --disable-static is passed to configure, then .a files won't be built
or installed. Make removing them in install-exec-hook not fatal if they
don't exist.
We need to be getting ConfigureNotify events for these, so we can respond
to changes in position of these windows. We cannot add this to windows
Metacity manages, as this makes it got mental.
ClutterActors for hidden windows (such windows on different than active
workspaces and windows that are minimized) are available, and reflect the
actual state of the window. This is intended for use in task-switchers etc.
This feature is disabled by default (due to increased demand on resources),
and can be enabled through the metacity/general/live_hidden_windows gconf key.
A trivial sample window switcher is included in the scratch plugin (activated
by clicking on the slide out panel).
terse variable names, simplify the plugin interface or consider tweaks
for maintainability.
* Renames plg -> plugin
* Renames mgr ->plugin_mgr (since in a combined window and composite
manager I think "mgr" will end up being ambiguous in places)
* Renames PluginWorkspaceRectangle -> MetaRectangle (We are no longer
concerned about mbwm2 portability)
* Renames a few one letter variable names e.g. a -> window, r ->rect
* Renames some vars to indicate what they represent not their data type,
e.g. group1, group2 ->workspace0, workspace1
* Renames the variable mcw -> mc_window to make it more immediately
obvious what it represents.
* Removes the verbose META_COMPOSITOR_CLUTTER_PLUGIN_SWITCH_WORKSPACE macro,
and just uses metacity_plugin instead.
* Instead of hanging data of the plugins global descriptor, we just use a
standalone static global variable.
* Make do_init a function pointer inside the plugin descriptors instead of
special casing it and using another g_module_symbol call. This also removes
the need for the META_COMPOSITOR_CLUTTER_PLUGIN_INIT_FUNC macro.
* A bunch of anal 80char fixes
* Removes the screen_width,height variables from the plugin descriptor struct
and add a plugin API instead.
The actor's private data created by the compositor is allocated
using g_new(), but since we are allocating a lot of small structures
all the time it's better to use the slice allocator instead.
Also, use a GQuark instead of using a string, so that the quark
lookup is done only once and the rest of the time is just an
integer comparison.
Renamed meta_compositor_clutter_plugin_manager_event_0 to
meta_compositor_clutter_plugin_manager_event_simple and
meta_compositor_clutter_plugin_manager_event_4i to
meta_compositor_clutter_plugin_manager_event_maximize for improved clarity.
Check for whether clutter/glx/clutter-glx-texture-pixmap.h is
available in the configure script and if not use
ClutterX11TexturePixmap directly.
glGetTexLevelParameter isn't available on GL ES so instead it checks
whether NPOTs textures are available and assumes the next power of two
size if not.
So we do not have to query window attributes in the MetaCompWindow constructor
but can pass them as a property (so we can gracefully handle the case where no
attributes can be retrieved).
Fixed up the build files so we do not build xrender compositor when building
clutter backend; moved clutter initialization to meta_ui_init() so commandline
arguments can be passed into clutter_init().