1
0
Fork 0
Commit graph

901 commits

Author SHA1 Message Date
Jasper St. Pierre
e3a0f2c546 default: Don't wait to show the stage
We can show it immediately now...
2014-02-17 13:57:35 -05:00
Jasper St. Pierre
a0ef7c7142 Move position-changed / size-changed signals to the MetaWindow
They fit more appropriately over here...

https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-02-14 23:44:39 -05:00
Jasper St. Pierre
4efe4483fb compositor: Delay meta_compositor_add_window until the first show
In order for the compositor to properly determine whether a client
is an X11 client or not, we need to wait until XWayland calls
set_window_id to mark the surface as an XWayland client. To prevent
the compositor from getting tripped up over this, make sure that
the window has been fully initialized by the time we call
meta_compositor_add_window.

https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-02-14 23:44:38 -05:00
Jasper St. Pierre
aec3edb1cc Always map the client and frame windows
Traditionally, WMs unmap windows when minimizing them, and map them
when restoring them or wanting to show them for other reasons, like
upon creation.

However, as metacity morphed into mutter, we optionally chose to keep
windows mapped for the lifetime of the window under the user option
"live-window-previews", which makes the code keep windows mapped so it
can show window preview for minimized windows in other places, like
Alt-Tab and Expose.

I removed this preference two years ago mechanically, by removing all
the if statements, but never went through and cleaned up the code so
that windows are simply mapped for the lifetime of the window -- the
"architecture" of the old code that maps and unmaps on show/hide was
still there.

Remove this now.

The one case we still need to be careful of is shaded windows, in which
we do still unmap the client window. In the future, we might want to
show previews of shaded windows in the overview and Alt-Tab. In that
we'd also keep shaded windows mapped, and could remove all unmap logic,
but we'd need a more complex method of showing the shaded titlebar, such
as using a different actor.

At the same time, simplify the compositor interface by removing
meta_compositor_window_[un]mapped API, and instead adding/removing the
window on-demand.

https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-02-14 23:19:41 -05:00
Jasper St. Pierre
593db0baee default: Make the map animation more friendly 2014-02-09 11:53:15 -05:00
Rico Tzschichholz
a8336669a3 shaped-texture: Fix unused variable warning
(cherry picked from commit 101a13c86d)
2014-02-05 22:51:46 +01:00
Jasper St. Pierre
f6db756326 shaped-texture: Move unobscured_region processing here
We want to remove a bunch of auxilliary duties from the MetaWindowActor
and MetaSurfaceActor, including some details of how culling is done.
Move the unobscured region culling code to the MetaShapedTexture, which
helps the actor become "more independent".

https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-02-05 14:42:38 -05:00
Jasper St. Pierre
27ab516f41 cullable: Reset the culling state instead of skipping the traversal
When we traversed down to reset the culling state, previously we
would just skip any actors that wanted culling. In order to properly
reset the unobscured_region before painting, we need to traverse down
to these places as well. Do this by calling cull_out with NULL regions
for both arguments, and adapt existing cull_out implementations to
match.

https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-02-05 14:24:08 -05:00
Jasper St. Pierre
9542b464bf window-actor: Clean up whitespace 2014-02-05 14:14:41 -05:00
Jasper St. Pierre
1ebaaa1950 shaped-texture: Clean up code flow a bit
This is easier for me to read.
2014-02-05 14:10:50 -05:00
Jasper St. Pierre
71efbf0330 shaped-texture: Constify clip
This matches upstream
2014-02-05 14:10:49 -05:00
Jasper St. Pierre
a6539463be shaped-texture: Remove get_clip
It seems that this code is trying to transform from "surface coordinates"
(the size of texture that's being displayed) to "actor coordinates"
(the actor's allocation), but I can't find any place where the two are
different. As such, let's just go back to using "surface coordinates"
everywhere and see what breaks.
2014-02-05 14:05:18 -05:00
Jonas Ådahl
183ad75603 default plugin: Fix workspace switch type error
Signed-off-by: Jonas Ådahl <jadahl@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=723563
2014-02-03 17:33:52 -05:00
Adel Gadllah
6bf1a66b7c window_actor: Remove the frame_messages timeout in destroy
Otherwise it might fire off later and cause a crash.

https://bugzilla.gnome.org/show_bug.cgi?id=723468
2014-02-02 15:15:20 +01:00
Jasper St. Pierre
d5d5c2167a compositor: Remove pending_input_region
Ever since the change to create the output window synchronously at startup,
there hasn't been any time where somebody could set a stage region the
output window was ready, so this was effectively dead code.

https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-01-31 17:21:00 -05:00
Jasper St. Pierre
b9755ea725 window-actor: Remove old unused APIs
https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-01-31 17:19:27 -05:00
Jasper St. Pierre
39fee9f5a2 window-actor: Flip set_redirected around
I know it's confusing with the triple negative, but unredirected is how
we track it elsewhere: we have an 'unredirected' flag, and 'should_unredirect'.

https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-01-31 17:19:26 -05:00
Jasper St. Pierre
d6282716b2 compositor: Simplify the unredirected window management code
https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-01-31 17:19:26 -05:00
Jasper St. Pierre
60d9bee3bf window-actor: Simplify the unredirected check in cull_out
https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-01-31 17:19:26 -05:00
Adel Gadllah
45cb151443 window-actor: Fix unobscured_region handling when computing paint volume
We currently ignore the unobscured region when we have mapped clones in
meta_window_actor_process_damage and meta_window_actor_damage_all but
use it unconditionally when computing the paint volume.

This is wrong. We should ignore it there as well or we will end up with
empty clones if the cloned window is completly obscured
(like the tray icons in gnome-shell).

https://bugzilla.gnome.org/show_bug.cgi?id=721596
2014-01-31 15:16:48 +01:00
Jasper St. Pierre
20545941fa Revert unintentional merge from wip/surface-content to wayland
This reverts a lot of commits.
2014-01-22 09:18:13 -05:00
Jasper St. Pierre
ba484be754 window-actor: Don't use TFP under XWayland
Simply have a NULL surface actor until the set_window_id arrives...
2014-01-21 19:01:34 -05:00
Jasper St. Pierre
a318198ab4 xwayland: Update the surface actor for the window on set_window_id
We need to do this for XWayland windows, since we only get the event
telling us they're an XWayland window after the compositor knows about
the window.
2014-01-21 19:01:34 -05:00
Jasper St. Pierre
e6391c2896 surface content 2014-01-21 19:01:34 -05:00
Jasper St. Pierre
7ea537fad7 Move position-changed / size-changed signals to the MetaWindow
They fit more appropriately over here...

https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-01-21 19:01:34 -05:00
Jasper St. Pierre
03146c2967 window-actor: Remove old unused APIs
https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-01-21 19:01:34 -05:00
Jasper St. Pierre
0a81314337 window-actor: Flip set_redirected around
I know it's confusing with the triple negative, but unredirected is how
we track it elsewhere: we have an 'unredirected' flag, and 'should_unredirect'.

https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-01-21 19:01:34 -05:00
Jasper St. Pierre
fa7a5782c6 compositor: Simplify the unredirected window management code
https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-01-21 19:01:34 -05:00
Jasper St. Pierre
e3b64912b6 window-actor: Simplify the unredirected check in cull_out
https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-01-21 19:01:34 -05:00
Jasper St. Pierre
a0fe392665 surface-actor: Move unobscured_region processing here
https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-01-21 19:01:34 -05:00
Jasper St. Pierre
0e5f365d55 compositor: Remove pending_input_region
Ever since the change to create the output window synchronously at startup,
there hasn't been any time where somebody could set a stage region the
output window was ready, so this was effectively dead code.
2014-01-21 19:01:34 -05:00
Jasper St. Pierre
bfc906cbc4 compositor: Remove meta_compositor_window_[un]mapped
We no longer unmap the toplevel windows during normal operation. The
toplevel state is tied to the window's lifetime.

Call meta_compositor_add_window / meta_compositor_remove_window instead...
2014-01-21 19:01:34 -05:00
Jasper St. Pierre
8e6f8087e8 Always map the client and frame windows
Traditionally, WMs unmap windows when minimizing them, and map them
when restoring them or wanting to show them for other reasons, like
upon creation.

However, as metacity morphed into mutter, we optionally chose to keep
windows mapped for the lifetime of the window under the user option
"live-window-previews", which makes the code keep windows mapped so it
can show window preview for minimized windows in other places, like
Alt-Tab and Expose.

I removed this preference two years ago mechanically, by removing all
the if statements, but never went through and cleaned up the code so
that windows are simply mapped for the lifetime of the window -- the
"architecture" of the old code that maps and unmaps on show/hide was
still there.

Remove this now.

The one case we still need to be careful of is shaded windows, in which
we do still unmap the client window. Theoretically, we might want to
show previews of shaded windows in the overview and Alt-Tab, so we remove
the complex unmap tracking for this later.
2014-01-21 19:01:18 -05:00
Jasper St. Pierre
56207ddb6a window-actor: Never unredirect when under Wayland
https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-01-20 16:14:56 -05:00
Jonas Ådahl
be698b597b shaped-texture: Use a double when calculating clip
For x defined below, x == -INT32_MAX assuming that the arithmetic
expression actually uses the fpu.

float f = 1.0f;
int32_t x = INT32_MAX * f;

This would result in the calculated clip width/height to be -INT_MAX
if the damage width/height is INT_MAX. To solve this, use a double
variable instead.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=705502
2014-01-16 13:27:59 -05:00
Jasper St. Pierre
7155d7e043 Properly set the number of components on the CoglTextureRectangle
We need to set the number of components on the CoglTextureRectangle to
prevent wasting too much GPU memory. As we need to do this before we call
cogl_texture_set_region, just remove the meta_texture_rectangle_new wrapper,
and make callers call cogl_texture_rectangle_new_with_size directly.
2014-01-13 13:28:38 -05:00
Jasper St. Pierre
419dfd333a Update for Cogl API breaks 2014-01-13 13:08:17 -05:00
Andika Triwidada
9b21346427 Changed obsolete FSF postal address into generic URL.
Fix https://bugzilla.gnome.org/show_bug.cgi?id=721517 #2
2014-01-13 11:35:47 -05:00
Jasper St. Pierre
ef2b6e7d00 window-actor: Fix optimization in get_paint_volume
We need to clip the paint volume to the unobscured region, not the
other way around...

https://bugzilla.gnome.org/show_bug.cgi?id=720630
2013-12-18 18:43:39 -05:00
Jasper St. Pierre
8131f34eb6 Move _NET_WM_WINDOW_OPACITY handling to the standard window-props interface 2013-12-09 15:53:23 -05:00
Jasper St. Pierre
f29241d90e compositor: Remove atom_x_root_pixmap
It's unused
2013-12-09 15:53:23 -05:00
Jasper St. Pierre
66af41f4a9 window-actor: Remove outdated code path
The shadow is added in the paint step, not as a separate actor,
so the raise is a no-op. It also gets rid of an annoying misspelling
that's driving me crazy.
2013-12-09 14:10:44 -05:00
Jasper St. Pierre
e30be380dd window-actor: Move signal handler connections to the meta-window setter 2013-12-09 14:08:01 -05:00
Jasper St. Pierre
65f2e29375 window-actor: Make the meta-window property construct-only
We don't deal with setting this property at all, and it's unlikely
to come up in future settings, so just don't allow setting it at all.

https://bugzilla.gnome.org/show_bug.cgi?id=678989
2013-12-09 14:08:01 -05:00
Jasper St. Pierre
98dbba1e17 window-actor: Remove meta-screen property
This can be inferred from the window. Don't allow anybody to set it.

https://bugzilla.gnome.org/show_bug.cgi?id=678989
2013-12-09 14:05:18 -05:00
Jasper St. Pierre
422648e2eb window-actor: Remove (private) xwindow property
This should make it easier to construct a MetaWindowActor from bindings.

https://bugzilla.gnome.org/show_bug.cgi?id=678989
2013-12-09 14:05:18 -05:00
Jasper St. Pierre
f0fa4d831a window: Add a simple meta_window_get_toplevel_xwindow utility
To replace all the places where we do:

  window->frame ? window->frame->xwindow : window->xwindow

or similar...
2013-12-09 14:05:18 -05:00
Jasper St. Pierre
1b600f5867 window-actor: Use g_signal_connect_object
To make our signal connections a bit more manageable...
2013-12-09 13:57:33 -05:00
Jasper St. Pierre
ca5b5e6bc4 surface-actor: Reindent 2013-12-06 20:28:39 -05:00
Jasper St. Pierre
57602adfe7 surface-actor: Don't use self->priv->foo directly
I don't like it...
2013-12-06 20:10:21 -05:00
Jasper St. Pierre
1481836ed6 surface-actor: Move work out of _new constructor
If we want to have any chance at creating subclasses of MetaSurfaceActor,
we can't do work in the constructor...
2013-12-06 20:10:21 -05:00
Jasper St. Pierre
283649b8d7 Support keybindings again, too 2013-12-05 17:18:49 -05:00
Jasper St. Pierre
29197d40c6 compositor: Don't assume we're a Wayland compositor 2013-12-05 17:18:49 -05:00
Owen W. Taylor
a796938b39 MetaWindowGroup: fix paint volume
In the past, MetaWindowGroup was allocated the size of the screen and
painted the size of the screen because it contained the screen background,
but now we also have the "top window group" which contains only popup
windows, so the allocation doesn't properly reflect the paint bounds
of the window group. Compute the paint bounds accurately from the
children.

https://bugzilla.gnome.org/show_bug.cgi?id=719669
2013-12-05 09:06:33 -05:00
Jasper St. Pierre
622c7a021b window-actor: Update shape at construction time
When we attach an existing surface actor, the allocation may not
change, so we need to ensure that the shape region and geometry is
valid...
2013-12-04 10:26:06 -05:00
Jasper St. Pierre
0924c7d61b wayland: Use a stage paint callback instead of a signal handler on "paint"
This is much more appropriate...
2013-12-03 14:49:40 -05:00
Jasper St. Pierre
2746608eb2 background-actor: Remove custom get_paint_volume
The paint volume should be based on what we paint, not what the content
wants to be painted as. Thus, it should be the allocation.
2013-12-03 14:36:29 -05:00
Jasper St. Pierre
0850da44d7 shaped-texture: Prevent a critical when setting a NULL cogl texture 2013-12-02 21:34:23 -05:00
Lionel Landwerlin
37ba264190 compositor: meta-surface-actor: upload texture changes at the correct position
https://bugzilla.gnome.org/show_bug.cgi?id=719695
2013-12-02 16:41:29 +00:00
Colin Walters
6c12c928df compositor: Update to latest cogl API
See https://git.gnome.org/browse/cogl/commit/?id=c76c1d136d2cac7f3d1331a4d1dc0dd0f06e812c

https://bugzilla.gnome.org/show_bug.cgi?id=719557
2013-11-29 11:08:51 -05:00
Jasper St. Pierre
5089a63d76 wayland-surface: Create the surface actor ourselves
Otherwise, we can't rely on a surface_actor being around to add
ourselves to...
2013-11-25 18:29:58 -05:00
Jasper St. Pierre
7841042a85 wayland-surface: Restructure code flow in wl_surface_attach a bit more... 2013-11-25 18:15:20 -05:00
Jasper St. Pierre
304005e04f wayland-surface: Replace MetaWindowActor with MetaSurfaceActor
Since subsurfaces won't have toplevel MetaWindowActors, we need to
use MetaSurfaceActor instead. These are embedded in the MetaWindowActor,
just like MetaShapedTexture was (in fact, MetaSurfaceActor now contains
a MetaShapedTexture)
2013-11-25 17:25:55 -05:00
Jasper St. Pierre
025ab35af7 surface-actor: Add setters for set_input_region / set_opaque_region
Subsurfaces won't have a MetaWindow or MetaWindowActor to fetch these from,
so they need to be tied directly to the MetaSurfaceActor.
2013-11-25 17:25:47 -05:00
Jasper St. Pierre
a27744503b shaped-texture: Make Cullable
Make MetaWindowActor chain up to the generic default MetaCullable
implementation, and remove the helper methods for MetaSurfaceActor
and MetaShapedTexture.
2013-11-25 17:25:47 -05:00
Jasper St. Pierre
1011331caf cullable: Use relative actor coordinates for culling
This ensures that nested cullables work fine.
2013-11-25 17:25:47 -05:00
Jasper St. Pierre
d3bc7570d0 window-actor: Update the shape region when the surface actor changes size 2013-11-25 17:18:22 -05:00
Jasper St. Pierre
74e43a4702 cullable: Turn cull_out / reset_culling into a separate interface
Instead of hardcoded knowledge of certain classes in MetaWindowGroup,
create a generic interface that all actors can implement to get parts of
their regions culled out during redraw, without needing any special
knowledge of how to handle a specific actor.

The names now are a bit suspect. MetaBackgroundGroup is a simple
MetaCullable that knows how to cull children, and MetaWindowGroup is the
"toplevel" cullable that computes the initial two regions. A future
cleanup here could be to merge MetaWindowGroup / MetaBackgroundGroup so
that we only have a generic MetaSimpleCullable, and move the "toplevel"
cullability to be a MetaCullableToplevel.

https://bugzilla.gnome.org/show_bug.cgi?id=714706
2013-11-25 15:21:36 -05:00
Jasper St. Pierre
0764b2058a window-actor: Move the operations we need to do when we cull out here
Soon, we'll move this into a generic MetaCullable interface, but for
now, just put hardcoded knowledge in MetaWindowGroup.

https://bugzilla.gnome.org/show_bug.cgi?id=714706
2013-11-25 15:19:08 -05:00
Jasper St. Pierre
7a787d7946 window-group: Decompose culling operations into two methods
This also fixes a bug in the translation of clip_region.

We will add an interface for this soon, so we can recursively cull like this...

https://bugzilla.gnome.org/show_bug.cgi?id=714706
2013-11-25 15:18:09 -05:00
Rui Matos
762fa0e116 compositor: Also redirect windows in wayland compositor mode
XWayland was doing this for us but now it isn't anymore.
2013-11-25 12:00:55 +01:00
Jasper St. Pierre
0be57b621b window-actor: Fix a copy/paste typo 2013-11-21 17:35:52 -05:00
Jasper St. Pierre
7d88b3593b surface-actor: Remove unused field 2013-11-21 17:29:41 -05:00
Jasper St. Pierre
858db7081a background-group: Fix cast warning 2013-11-21 15:14:40 -05:00
Jasper St. Pierre
5af7f619c8 background-group: Use the Clutter iteration APIs 2013-11-21 14:24:32 -05:00
Jasper St. Pierre
e5e35e5a7f background-group: Remove some unnecessary cruft 2013-11-21 14:24:32 -05:00
Jasper St. Pierre
2952d3671d window-actor: Set as unreactive when hiding
This means that we should never pick the actor when it's being destroyed.
2013-11-19 19:35:34 -05:00
Jasper St. Pierre
1b5ace8256 window-actor: Don't set ourselves as reactive twice 2013-11-19 19:35:34 -05:00
Jasper St. Pierre
4326d0bf3a compositor: Make sure to construct plugin_mgr in Wayland as well... 2013-11-19 15:37:31 -05:00
Owen W. Taylor
b9da43b753 Rename meta_window_get_outer_rect() to meta_window_get_frame_rect()
For clarity, rename meta_window_get_outer_rect() to match terminology
we use elsewhere. The old function is left as a deprecated
compatibility wrapper.
2013-11-19 14:04:16 -05:00
Jasper St. Pierre
26aa10a974 compositor: Clean up comment
So it seems that we were intentionally delaying the output window,
although I wonder why...
2013-11-19 13:52:45 -05:00
Jasper St. Pierre
f6144082b1 compositor: Initialize the plugin manager after initializing the output window
Plugins like gnome-shell may want to grab the output window immediately
before bouncing back to the mainloop.
2013-11-19 13:52:13 -05:00
Jasper St. Pierre
c749f7b6fb Revert "ff"
This reverts commit 74462133ca.

Pushed by accident, if it wasn't obvious...
2013-11-19 11:22:49 -05:00
Jasper St. Pierre
74462133ca ff 2013-11-18 21:35:30 -05:00
Jonas Ådahl
7c45d6594c MetaWindowActor: Use allocation changes signals for size changed signals
When a Wayland compositor, simply rely on the clutter actor allocation
changed signal to sync geometry and emit window actor size changed
signals.

Attaching a wl_buffer to a MetaShapedTexture will signal allocation
changed on the corresponding MetaSurfaceActor, which the MetaWindowActor
is listening to.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=705502
2013-11-18 21:19:01 -05:00
Jonas Ådahl
ea916b6c49 Introduce MetaSurfaceActor for drawing MetaWindowActor content
Instead of having MetaWindowActor only have one single MetaShapedTexture
as actor drawing its content, introduce a new abstract MetaSurfaceActor
that takes care of drawing.

This is one step in the direction to decouple MetaWaylandSurface with a
MetaWindow and MetaWindowActor (except for shell/xdg surfaces) in order
to finally support subsurfaces like features, or any feature where
window is not drawn using a single texture.

The first step, implemented in this patch, is to not have
MetaWindowActor work directly with a shaped texture. There are still
some cases where it simply gets the texture and goes on as before, but
this should be changed by either removing the need of going via
MetaWindowActor or by adding some generic interface to MetaSurfaceActor
that doesn't limit its functionality to one shaped texture.

There should be no visible difference nor after this patch, but
meta_window_actor_get_texture() and meta_surface_actor_get_texture()
should be deprecated when equivalent functionality has been introduced.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=705502
2013-11-18 21:19:00 -05:00
Jasper St. Pierre
a02d734243 window-actor: Move all buffer management and damage correction here
We want ShapedTexture to be a dumb actor that knows how to
pick/paint fairly easily, without any "platform knowledge", so to say...
2013-11-18 21:19:00 -05:00
Jasper St. Pierre
735b736110 shaped-texture: Use the cogl helper methods for fetching shm_buffer contents
Rather than doing the set_region ourselves.
2013-11-18 21:19:00 -05:00
Jasper St. Pierre
8dd97b4998 compositor: Remove outdated comment
XWayland no longer redirects windows by default.
2013-11-18 21:18:59 -05:00
Jasper St. Pierre
1f569bef76 Fix dragging on move/resize grabs
We need to use the grab_window for incoming events if we have an active grab.
2013-11-18 18:38:24 -05:00
Jasper St. Pierre
662c9729bc trivial: window-actor: Fix formatting 2013-11-17 19:16:30 -05:00
Jasper St. Pierre
56a0dd6b2c trivial: shaped-texture: Move set_base_texture to set_cogl_texture
A simple code cleanup.
2013-11-17 19:16:29 -05:00
Jasper St. Pierre
9dc6028b3d trivial: shaped-texture: Fix documentation typo 2013-11-17 19:16:29 -05:00
Hans Petter Jansson
dc4e1d4cd1 shaped-texture: Use nearest-pixel interpolation if the texture is unscaled
Use nearest-pixel interpolation if the texture is unscaled. This
improves performance, especially with software rendering.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=708389
2013-10-10 11:14:05 -04:00
Adel Gadllah
c24d9bf142 meta-window-actor: Fix offset calculation in queue_send_frame_messages_timeout
The current time offset calculation is wrong. It is supposed to calculate
the offset between the current time and the
"time where it message should be sent" (last_time + interval).

Fix the math to actually do that.

https://bugzilla.gnome.org/show_bug.cgi?id=709340
2013-10-07 20:22:53 +02:00
Giovanni Campagna
e965cf32d4 MetaWindowActor: fix updates with multiple size changes in one frame
We must set x11_size_changed even if we are frozen, as every window
size change makes the X server drop the pixmap, and we might lose
the information at the next thaw() if the window changes size
twice in one frame (so we would keep drawing with the old pixmap
until something else causes another resize)
2013-09-25 19:23:58 +02:00
Giovanni Campagna
a7eaf43e18 wayland: implement resizing and maximization for wayland clients
To properly resize clients, we need to send them configure events
with the size we computed from the constraint system, and
then check if the new size they ask is compatible with
our expectation.

Note that this does not handle interactive resizing yet, it
merely makes the API calls work for wayland clients.

https://bugzilla.gnome.org/show_bug.cgi?id=707401
2013-09-16 14:46:34 +02:00
Giovanni Campagna
42a5f4f479 MetaShapedTexture: don't intersect a region with an uninitialized clip
If we skip getting the clip rectangle because we don't have an
allocation or a texture, don't intersect with the visible region.
This avoids a pixman warning of an invalid rectangle.

Reviewed by drago01 in IRC.
2013-09-16 11:28:12 +02:00
Pavel Vasin
b9247b4b2f shaped-texture: Fix memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=708070
2013-09-14 17:07:32 +02:00
Giovanni Campagna
7b537d6b8f Fix regression in mutter-wayland translations
Switching meta/util.h to gi18n.h was wrong, mutter is a library
and needs gi18n-lib.h, but that cannot be included from a public
header (since it depends on config.h or command line options),
so split util.h into a public and a private part.

https://bugzilla.gnome.org/show_bug.cgi?id=707897
2013-09-11 16:01:07 +02:00
Giovanni Campagna
004ee2d3b5 MetaPluginManager: don't require plugins to pass events to clutter
We don't want the shell to know if it's running on ClutterX11 or
not, so we should forward the event ourselves.

https://bugzilla.gnome.org/show_bug.cgi?id=707482
2013-09-10 17:26:15 +02:00
Adel Gadllah
2d67b01c3a window-actor: Use more conservative paint volume
We know which part of the window is not obscured, so take advantaged of that
to limit the size of the paint volume that we report.
2013-09-04 20:08:24 +02:00
Neil Roberts
6014d31dea Don't create a dummy texture for the texture pipeline template
The meta_create_texture_pipeline function used to create a dummy 1x1
texture so that it could make sure that the all of the state that
affects the shader generation would be set on the template pipeline so
that Cogl could share the pipeline's shader with any other pipelines
that are just rendering a texture. This is no longer necessary because
the only thing that affects the shader generation is the texture type,
not the actual texture data and Cogl now has a function to explicitly
set the texture type which we can use instead. Additionally even if
the template mechanism is not used at all Cogl will still end up
reusing the same shader because it now has a shader cache which is
indexed by the pipeline state so pipeline's don't strictly need to
share ancestry in order to take advantage of it. However we still
might as well use the function because if there is a common ancestry
it is faster to look up the shader because Cogl doesn't need to hash
the pipeline state.

https://bugzilla.gnome.org/show_bug.cgi?id=707458
(cherry picked from commit c5bf60eab4)
2013-09-04 15:29:04 +01:00
Jasper St. Pierre
ddb9929dad compositor: Remove some uninitialized variables 2013-09-03 16:10:10 -04:00
Ray Strode
7ac9a6e241 compositor: initial has_window to FALSE in sync_actor_stacking
Spotted by Jasper, discussed on IRC.
2013-09-03 16:09:05 -04:00
Giovanni Campagna
b53bf0e8c2 Fix distcheck
Missing translation files, missing dists and some -Werrors.
2013-09-03 17:00:18 +02:00
Giovanni Campagna
7eb4bfbea3 wayland: implement support for plugin modality
Calling XIGrabDevice has no effect under wayland, because the
xserver is getting events from us. Instead, we need to use our
own interfaces for grabs.
At the same time, we can simplify the public API, as plugins
should always listen for events using clutter.

https://bugzilla.gnome.org/show_bug.cgi?id=705917
2013-08-30 10:37:25 +02:00
Jasper St. Pierre
57406e0a9e shaped-texture: Actually fetch rectangles from the blended_region
We checked for the blended region but actually fetched rectangles from
the clip region.
2013-08-29 18:35:18 -04:00
Jasper St. Pierre
1987cbb764 window-actor: Fix build 2013-08-29 17:16:15 -04:00
Jasper St. Pierre
705978405b shaped-texture: Fix build 2013-08-29 17:14:11 -04:00
Adel Gadllah
daba05f6a7 background: Rename visible_region to clip_region
This does better reflect what this region is used for.

https://bugzilla.gnome.org/show_bug.cgi?id=703332
2013-08-29 17:08:57 -04:00
Jasper St. Pierre
1a7984be43 window-actor: Use g_clear_pointer 2013-08-29 17:05:41 -04:00
Jasper St. Pierre
1b3c77d53a shaped-texture: Remove an unnecessary set to NULL 2013-08-29 17:05:36 -04:00
Jasper St. Pierre
5b0f0d9e5b shaped-texture: Remove bad comment
We do not assume ownership of the clip region anymore.
2013-08-29 17:04:55 -04:00
Adel Gadllah
9816659fa9 meta-window-actor: Fix spacing 2013-08-29 17:04:50 -04:00
Adel Gadllah
3b1b611634 meta-window-actor: Throttle obscured frame synced apps
We must send frame_drawn and frame_timing messages to even when
we don't actually queue a redraw on screen to comply with the
WM sync spec.

So throttle such apps to down to a ~100ms interval.

https://bugzilla.gnome.org/show_bug.cgi?id=703332
2013-08-29 17:04:36 -04:00
Adel Gadllah
f08921bd0c meta-shaped-texture: Don't queue redraws for obscured regions
When we get a damage event we update the window by calling
meta_shaped_texture_update_area which queues a redraw on the actor.
We can avoid that for obscured regions by comparing the damage area to
our visible area.

This patch causes _NET_WM_FRAME_DRAWN messages to be not sent in some cases
where they should be sent; they will be added back in a later commit.

https://bugzilla.gnome.org/show_bug.cgi?id=703332
2013-08-29 17:03:48 -04:00
Jasper St. Pierre
0089b5769c shaped-texture: Turn blending off when drawing entirely opaque regions
When drawing entirely opaque regions, we traditionally kept blending on
simply because it made the code more convenient and obvious to handle.
However, this can cause lots of performance issues on GPUs that aren't
too powerful, as they have to readback the buffer underneath.

Keep track of the opaque region set by windows (through _NET_WM_OPAQUE_REGION,
Wayland opaque_region hints, standard RGB32 frame masks or similar), and draw
those rectangles separately through a different path with blending turned off.

https://bugzilla.gnome.org/show_bug.cgi?id=707019
2013-08-29 15:31:53 -04:00
Jasper St. Pierre
452be05ea0 shaped-texture: Use non-deprecated cogl APIs
https://bugzilla.gnome.org/show_bug.cgi?id=707019
2013-08-29 15:31:53 -04:00
Jasper St. Pierre
69f038f7c7 shaped-texture: Simplify pipeline creation
Split out pipeline creation to a separate function so that we don't
have so much dense code in the paint function itself, and remove some
indentation levels.

Also, don't use our own template for the unmasked pipeline, since it
has nothing different from the default pipeline template.

We also don't store the pipelines anymore since their creation isn't
really helping us; we set the mask texture and paint texture on every
paint anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=707019
2013-08-29 15:31:52 -04:00
Jasper St. Pierre
2d35e07fae wayland: Add support for set_opaque_region / set_input_region
https://bugzilla.gnome.org/show_bug.cgi?id=707019
2013-08-29 15:31:52 -04:00
Jasper St. Pierre
95e2d26d03 window-actor: Mark all Wayland clients as argb32
https://bugzilla.gnome.org/show_bug.cgi?id=707019
2013-08-29 15:26:49 -04:00
Giovanni Campagna
9a4783e364 Integrate the monitor manager with wayland
Use the right backend when running as a wayland compositor,
export the data to wayland clients, and use it to keep the stage
appropriately sized.
2013-08-27 10:09:39 +02:00
Giovanni Campagna
aa15c09d54 Merge tag 'xrandr_branch_point' into wayland-kms-base
Conflicts:
	src/Makefile.am
	src/core/display.c
	src/core/screen-private.h
	src/core/screen.c
2013-08-27 10:07:39 +02:00
Tim Lunn
ab72352c47 background: don't save pixbuf in user data
https://bugzilla.gnome.org/show_bug.cgi?id=706777
2013-08-27 09:57:06 +02:00
Giovanni Campagna
bd3d5df9ce Remove HAVE_WAYLAND ifdefs
Wayland support is always enabled now.

https://bugzilla.gnome.org/show_bug.cgi?id=705497
2013-08-26 15:00:29 +02:00
Giovanni Campagna
1617323dca MetaShapedTexture: don't include private headers in public ones
Private headers are not installed, so they can't be referenced
from public ones.

https://bugzilla.gnome.org/show_bug.cgi?id=705497
2013-08-26 15:00:29 +02:00
Jasper St. Pierre
9682a2aea4 window-group: Fix compiler warning 2013-08-23 22:11:37 -04:00
Giovanni Campagna
876f81db12 compositor: fix focusing the stage window
We can't use the X11 stage window, if clutter is not using the X11
backend (and even if it was, it would be bogus when the xwayland
server is not the one clutter is talking to). Instead, we introduce
the concept of "focus type", which we use to differentiate the
various meanings of None in the focus_xwindow field.

https://bugzilla.gnome.org/show_bug.cgi?id=706364
2013-08-20 14:41:24 +02:00
Giovanni Campagna
75f3ae14b5 MetaPlugin: simplify the modal API
Remove grab window and cursor from the API, and just grab always
on the stage window with no cursor.
This is mainly to remove the X11 usage in the public API, in preparation
for implementing this in wayland.

https://bugzilla.gnome.org/show_bug.cgi?id=705917
2013-08-20 14:25:49 +02:00
Giovanni Campagna
5086626805 MetaPlugin: add a UI hook for confirming display changes
We want to show a dialog when a display change happens from the
control center. To do so, add a new vfunc to MetaPlugin and
call it when a configuration change is requested via DBus.

https://bugzilla.gnome.org/show_bug.cgi?id=705670
2013-08-18 00:47:53 +02:00
Giovanni Campagna
fc67c707e4 default plugin: add a random color background on each monitor
Instead of a full white background, make one with a random color.
This way the different "monitors" are visible and it's easier
to debug the DBus API.

https://bugzilla.gnome.org/show_bug.cgi?id=705670
2013-08-18 00:32:44 +02:00
Giovanni Campagna
bfc87d13cb MetaWindowActor: fix reference counting issue
We need to use g_signal_connect_object(), rather than g_signal_connect(),
because the window actor can be destroyed before the window emits
the final notify::appears-focused inside unmanage, if the plugin
decides that it doesn't want to animate the destruction (which
happens with dialogs and the default plugin)

https://bugzilla.gnome.org/show_bug.cgi?id=706207
2013-08-18 00:22:07 +02:00
Giovanni Campagna
506ddc3d6c MetaWindowActor: fix reference counting issue
We need to use g_signal_connect_object(), rather than g_signal_connect(),
because the window actor can be destroyed before the window emits
the final notify::appears-focused inside unmanage, if the plugin
decides that it doesn't want to animate the destruction (which
happens with dialogs and the default plugin)

https://bugzilla.gnome.org/show_bug.cgi?id=706207
2013-08-18 00:16:59 +02:00
Giovanni Campagna
152d896f75 MetaWindowActor/wayland: make sure the mapped bit is correctly set
Otherwise it stays FALSE for OR windows, causing the shape region
to be empty and the actor culled from drawing.

https://bugzilla.gnome.org/show_bug.cgi?id=706078
2013-08-15 17:41:34 +02:00
Giovanni Campagna
9a5f243f73 wayland: refactor window destruction and focus
The previous code was leaving focus fields dirty in MetaWaylandPointer
and MetaWaylandKeyboard at time (which could crash the X server
because of invalid object IDs)
The new code is more tighly integrated in the normal X11 code
for handling keyboard focus (meaning that the core idea of input
focus is also correct now), so that meta_window_unmanage() can
do the right thing. As a side benefit, clicking on wayland clients
now unfocus X11 clients.
For the mouse focus, we need to clear the surface pointer when
the metawindowactor is destroyed (even if the actual actor is
kept alive for effects), so that a repick finds a different pointer
focus.

https://bugzilla.gnome.org/show_bug.cgi?id=705859
2013-08-13 09:42:55 +02:00
Giovanni Campagna
03f55b9485 wayland: fix a #warning
Remove window_surfaces, as the FIXME asks for. We don't need it
because we can obtain the surface from the MetaWindow, and
follow the wayland compositor path for both types of clients.

https://bugzilla.gnome.org/show_bug.cgi?id=705818
2013-08-13 09:42:55 +02:00
Neil Roberts
268ebb1b18 wayland: Add basic input support
This copies the basic input support from the Clayland demo compositor.
It adds a basic wl_seat implementation which can convert Clutter mouse
events to Wayland events. For this to work all of the wayland surface
actors need to be made reactive.

The wayland keyboard input focus surface is updated whenever Mutter
sees a FocusIn event so that it will stay in synch with whatever
surface Mutter wants as the focus. Wayland surfaces don't get this
event so for now it will just give them focus whenever they are
clicked as a hack to test the code.

Authored-by: Neil Roberts <neil@linux.intel.com>
Authored-by: Giovanni Campagna <gcampagna@src.gnome.org>
2013-08-10 19:13:49 -04:00
Robert Bragg
f9a11b3b18 wayland: Adds basic hybrid X + Wayland support
This adds support for running mutter as a hybrid X and Wayland
compositor. It runs a headless XWayland server for X applications
that presents wayland surfaces back to mutter which mutter can then
composite.

This aims to not break Mutter's existing support for the traditional X
compositing model which means a single build of Mutter can be
distributed supporting the traditional model and the new Wayland based
compositing model.

TODO: although building with --disable-wayland has at least been tested,
I still haven't actually verified that running as a traditional
compositor isn't broken currently.

Note: At this point no input is supported

Note: multiple authors have contributed to this patch:
Authored-by: Robert Bragg <robert@linux.intel.com>
Authored-by: Neil Roberts <neil@linux.intel.com>
Authored-by: Rico Tzschichholz.
Authored-by: Giovanni Campagna <gcampagna@src.gnome.org>
2013-08-10 19:13:48 -04:00
Robert Bragg
531be6c413 Track the X Shape input region and use it for picking
We now track whether a window has an input shape specified via the X
Shape extension. Intersecting that with the bounding shape (as required
by the X Shape extension) we use the resulting rectangles to paint
window silhouettes when picking. As well as improving the correctness of
picking this should also be much more efficient because typically when
only picking solid rectangles then the need to actually render and issue
a read_pixels request can be optimized away and instead the picking is
done on the cpu.
2013-08-10 19:13:48 -04:00
Adel Gadllah
4862872c78 window-actor: Fix doc comment
https://bugzilla.gnome.org/show_bug.cgi?id=703332
2013-08-05 16:29:37 +02:00
Rico Tzschichholz
90a3d613ca meta-window-group: Fix previous commit 2013-07-18 16:33:50 +02:00
Adel Gadllah
c2af13cf31 meta-window-group: Fix compile warning 2013-07-18 16:24:24 +02:00
Adel Gadllah
e3855c77af meta-window-group: Use clutter's iteration API
Use the clutter iteration API instead of copying the list of children.
This is more efficent.

https://bugzilla.gnome.org/show_bug.cgi?id=703332
2013-07-17 19:37:13 +02:00
Jasper St. Pierre
3b51405255 main: Don't select for touch events on the stage
GNOME Shell's actors aren't touch capable, so we need to make sure that
they get the fallback pointer emulated events for now. This fixes the top
bar and other elements not working on a touchscreen without a grab.

https://bugzilla.gnome.org/show_bug.cgi?id=697192
2013-07-15 12:47:46 -04:00
Jasper St. Pierre
73dbb4b9a5 window-actor: Remove another unused field 2013-07-15 12:20:26 -04:00
Jasper St. Pierre
51acc3ee31 window-actor: Remove unused description
The desc field would never get filled in, as we can't have a window
actor without a MetaWindow, also, so remove the storage for the field.
2013-07-15 12:20:26 -04:00
Jasper St. Pierre
a6f206f07c window-actor: Remove a field we don't use 2013-07-15 12:20:13 -04:00
Ray Strode
b76c3312e9 Revert "background: Allow using sliced textures"
This reverts commit f743539886.

( accidentally pushed this when trying to push commit
  b7840bec7d )
2013-07-01 07:33:19 -04:00
Ray Strode
fd7db8e6b3 Revert "background: downscale background to fit in texture limits"
This reverts commit 15e01152da.

( accidentally pushed this when trying to push commit
  b7840bec7d )
2013-07-01 07:31:25 -04:00
Ray Strode
b7840bec7d background: Allow using sliced textures for file based backgrounds
Some cards have 2k texture limits, which can be smaller than
commonly sized backgrounds.

One way to get around this problem is to use Cogl's "sliced texture"
feature, that transparently uses several hardware textures under the hood.

This commit changes background textures loaded from file to potentially
use slicing.  Based on a patch by Jasper St. Pierre
<jstpierre@mecheye.net>.

https://bugzilla.gnome.org/show_bug.cgi?id=702283
2013-07-01 07:28:59 -04:00
Jasper St. Pierre
f743539886 background: Allow using sliced textures
https://bugzilla.gnome.org/show_bug.cgi?id=702283
2013-07-01 07:28:32 -04:00
Ray Strode
15e01152da background: downscale background to fit in texture limits
Some cards have 2k texture limits, which can be smaller than
commonly sized backgrounds.

This commit downscales the background in this situation, so that
it won't fail to load.

https://bugzilla.gnome.org/show_bug.cgi?id=702283
2013-07-01 07:28:32 -04:00
Jasper St. Pierre
96221e6c04 compositor: Add an API to query if the stage is focused
gnome-shell needs to know whether the stage window is focused so
it can synchronize between stage window focus and Clutter key actor
focus. Track all X windows, even those without MetaWindows, when
tracking the focus window, and add a compositor-level API to determine
when the stage is focused.

https://bugzilla.gnome.org/show_bug.cgi?id=700735
2013-06-20 17:21:54 -04:00
Adel Gadllah
2a5b068863 compositor: Prevent an error in application code from keeping unredirect on permanently
We substract one from the unredirect counter when enable_unredirect_for_screen
gets called. It is an unsigned integer so substracting one from zero (which means enable) would overflow and thus keep it peramently enabled.

This should never happen because it means there is an unmatched
enable / disable pair somewhere. So in addition to fixing it add a
warning when this case gets triggered.

https://bugzilla.gnome.org/show_bug.cgi?id=701224
2013-06-18 22:18:38 +02:00
Allan Day
0c505faded make the window shadows lighter
Subtler shadows look more refined.

https://bugzilla.gnome.org/show_bug.cgi?id=702141
2013-06-18 17:26:24 +01:00
Owen W. Taylor
47b21b3547 Use new clutter_stage_set_paint_callback() function for after-paint notification
Commit 4f2bb583bf changed things so that the compositor used
clutter_threads_add_repaint_func_full (CLUTTER_REPAINT_FLAGS_POST_PAINT
to get after-paint notification and send _NET_WM_FRAME_DRAWN, but this
doesn't actually work, since Clutter will already have blocked for
VBlank before calling post-paint functions.

The result is that frame synced toolkits like GTK 3.8 will normally
only be able to draw every other frame.

Since ::paint doesn't work either, a new function
clutter_stage_set_paint_callback() has been added to Clutter
(and will be included in the 1.14 branch)

https://bugzilla.gnome.org/show_bug.cgi?id=698794
2013-06-03 13:21:54 -04:00
Jasper St. Pierre
bd19de9429 compositor: Add an API to focus the stage X window
gnome-shell has traditionally just called XSetInputFocus when wanting to
set the input focus to the stage window, but this might cause strange,
hard-to-reproduce bugs because of an interference with mutter's focus
prediction. Add API to allow gnome-shell to focus the stage window that
also updates mutter's internal focus prediction state.

https://bugzilla.gnome.org/show_bug.cgi?id=700735
2013-05-24 17:43:37 -04:00
Giovanni Campagna
e10804727d compositor: remove the overlay_group concept
The hierarchy handling is handled in the shell by adding stuff
directly to the uiGroup, and we have a dedicated actor for
the overview there, so we don't need this anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=700735
2013-05-22 18:36:05 +02:00
Stef Walter
dfa4c7d670 compositor: Fix regression of shaded windows
Fix issues drawing shaded window shadows.

https://bugzilla.gnome.org/show_bug.cgi?id=693714
2013-05-15 16:52:28 +02:00
Pavel Vasin
8880dffbdb background: Fix memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=698710
2013-04-29 14:58:30 +02:00
Simon McVittie
c2a9ccb7e2 Let the UI layer (via the core) construct the frame mask
This essentially just moves install_corners() from the compositor, through
the core, into the UI layer where it arguably should have been anyway,
leaving behind stub functions which call through the various layers. This
removes the compositor's special knowledge of how rounded corners work,
replacing it with "ask the UI for an alpha mask".

The computation of border widths and heights changes a bit, because the
width and height used in install_corners() are the
meta_window_get_outer_rect() (which includes the visible borders but not
the invisible ones), whereas the more readily-available rectangle is the
MetaFrame.rect (which includes both). Computing the same width and height
as meta_window_get_outer_rect() involves compensating for the invisible
borders, but the UI layer is the authority on those anyway, so it seems
clearer to have it do the calculations from scratch.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=697758
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
2013-04-17 13:35:06 +01:00
Jasper Lievisse Adriaanse
992a15e640 Don't redefine MetaBackgroundPrivate, fixing a build issue:
compositor/meta-background.c:64: error: redefinition of typedef 'MetaBackgroundPrivate'
./meta/meta-background.h:51: error: previous declaration of 'MetaBackgroundPrivate' was here
2013-03-29 16:59:26 +01:00
Ray Strode
577e5e2e1a background: don't tank if background is destroyed before it gets a pipeline
Right now we call unset_texture from MetaBackground's dispose method.

unset_texture assumes there's a pipeline available, but there may not
be if the object was just created.

This commit fixes that incorrect assumption.

https://bugzilla.gnome.org/show_bug.cgi?id=696157
2013-03-26 16:58:22 -04:00
Ray Strode
47cf63bebe background: share snippets between pipelines
Cogl automatically caches pipelines with no eviction policy,
so we need to make sure to reuse snippets to prevent
identical pipelines from getting cached separately.

https://bugzilla.gnome.org/show_bug.cgi?id=696157
2013-03-26 16:58:22 -04:00
Ray Strode
0e58906194 background: drop saturation and blur effects
We don't use them anymore, so drop them.

https://bugzilla.gnome.org/show_bug.cgi?id=696157
2013-03-26 16:58:22 -04:00
Ray Strode
13c7020b80 background: fix pixbuf leak in load_file_finish
g_task_propagate_pointer relinishes the GTask
of its reference to the propagated pointer, so we need to
unref it ourselves when we're done with it.

https://bugzilla.gnome.org/show_bug.cgi?id=696157
2013-03-26 16:58:22 -04:00
Ray Strode
5ed6e37e3c background: fix task leak in load_file_async
g_task_run_in_thread takes its own reference to the
task passed in, so we can unref the initial reference.

https://bugzilla.gnome.org/show_bug.cgi?id=696157
2013-03-26 16:58:21 -04:00
Tomeu Vizoso
9df2d83aa0 Add small note to the docs about the actor containers in the compositor
https://bugzilla.gnome.org/show_bug.cgi?id=695935
2013-03-18 23:08:24 +01:00
Tomeu Vizoso
1582448553 Move compositor documentation from header to the API docs
https://bugzilla.gnome.org/show_bug.cgi?id=695935
2013-03-18 23:08:24 +01:00
Jasper St. Pierre
e216b6ca0f background: Fix the desaturate effect when on its own
We need to make sure cogl_texel is set to something,
otherwise we'll have junk.

https://bugzilla.gnome.org/show_bug.cgi?id=696087
2013-03-18 15:23:19 -04:00
Jasper St. Pierre
af01ddaf5d background-group: Use a default FixedLayout manager
ClutterBinLayout's get_preferred_width / get_preferred_height
doesn't respect fixed child positioning when calculating the
size of the layout, but does when allocating. This is absurdly
broken, but it's what we're given. Use a ClutterFixedLayout,
which doesn't have these issues.

https://bugzilla.gnome.org/show_bug.cgi?id=696089
2013-03-18 14:52:06 -04:00
Tomeu Vizoso
2efed44257 Add a meaningful name and description to all sections/files in the API docs
https://bugzilla.gnome.org/show_bug.cgi?id=695641
2013-03-14 18:11:04 -04:00
Tomeu Vizoso
be46869782 docs: Fix cross-reference generation
https://bugzilla.gnome.org/show_bug.cgi?id=676856
2013-03-14 18:02:43 -04:00
Tomeu Vizoso
e0b698d365 Fix gobs of gtk-doc warnings
https://bugzilla.gnome.org/show_bug.cgi?id=676856
2013-03-14 18:02:43 -04:00
Jasper St. Pierre
e46c7fd27b Update and fix comments 2013-03-14 17:55:31 -04:00
Jasper St. Pierre
0bb8d29be4 background-group: Subclass ClutterActor, not ClutterGroup
We use the new Clutter Actor API in the shell, so we really
shouldn't be using ClutterGroup.

https://bugzilla.gnome.org/show_bug.cgi?id=695881
2013-03-14 17:48:36 -04:00
Jasper St. Pierre
1f905bd0e2 compositor: Fix crash when adding a window with an opaque region
If _NET_WM_OPAQUE_REGION is set when the window is first mapped, the
initial load_properties will happen before the window actor is created,
and we'll have a call to meta_compositor_window_shape_changed. Just
fizzle this call out instead of doing anything fancy, as we'll pick
up the opaque region when the window actor is eventually created.

https://bugzilla.gnome.org/show_bug.cgi?id=695813
2013-03-14 11:35:23 -04:00
Giovanni Campagna
889844b004 Compositor: sync stacking of window actors even if they're not parented to the window groups
Window actors might be temporarily parented to intermediate actors during
effect, but we should not require that the plugin keeps track of stacking.
Rather, assume that the intermediate groups holds a whole stack, and
applying position within it.

https://bugzilla.gnome.org/show_bug.cgi?id=695711
2013-03-12 17:58:00 +01:00
Ray Strode
e15bc37225 compositor: map overlay window before redirecting windows
When windows get redirected off screen, all that gets left behind
is black. We don't want to flicker black at startup, though.

This commit maps the overlay window early, before redirecting
toplevels, so they end up getting snapshotted onto the background
pixmap of the overlay window when the overlay window is mapped.

https://bugzilla.gnome.org/show_bug.cgi?id=694321
2013-03-04 16:16:56 -05:00
Ray Strode
160150d127 compositor: don't show stage right away
We don't want the stage shown until gnome-shell is ready for it.
This commit ensures the stage isn't shown implicitly.

https://bugzilla.gnome.org/show_bug.cgi?id=694321
2013-03-04 16:16:56 -05:00
Owen W. Taylor
6e02fb80c4 Always send _NET_WM_FRAME_DRAWN for newly created windows
Send a _NET_WM_FRAME_DRAWN for each newly created window, as required
by the specification. This avoids a race where a window might be created
frozen but already unfrozen by the time we first see fetch the
counter value.

Remove a duplicate call to meta_compositor_set_updates_frozen() which
was called before the MetaWindowActor is created and hence did nothing.

https://bugzilla.gnome.org/show_bug.cgi?id=694771
2013-03-04 15:36:13 -05:00
Pavel Vasin
4d437e32e0 window-actor: Fix leaked frame list
https://bugzilla.gnome.org/show_bug.cgi?id=695135
2013-03-04 19:07:23 +01:00
Pavel Vasin
7db236b2a4 window-actor: Fix leaked opaque_region
https://bugzilla.gnome.org/show_bug.cgi?id=695135
2013-03-04 19:07:23 +01:00
Rui Matos
660eceb61a compositor: Fix ClutterTimeline usage
Use the correct 'stopped' signal name and callback signature.

https://bugzilla.gnome.org/show_bug.cgi?id=695093
2013-03-04 00:25:19 +01:00
Jasper St. Pierre
d395d75e26 Fix up for latest Clutter deprecations
https://bugzilla.gnome.org/show_bug.cgi?id=678917
2013-03-03 16:23:32 -05:00
Adel Gadllah
c996dde5cb meta-window-group: Report a paint volume
We never paint outside of the allocation so we can simply use
clutter_paint_volume_set_from_allocation.

https://bugzilla.gnome.org/show_bug.cgi?id=694988
2013-03-03 11:46:06 +01:00
Ray Strode
6e831c88a6 compositor: fix background vignette for non-stretched styles
The background vignette currently fits itself to the painted
texture, instead of the monitor.  This causes some very
wrong looking drawing for backgrounds that don't fill the screen.

This commit reworks the vignette shader code to be clearer, more
correct, and parameterized so that it knows how to scale and
position the vignette.

https://bugzilla.gnome.org/show_bug.cgi?id=694393
2013-03-02 17:31:43 -05:00
Ray Strode
0e3d164117 compositor: when tiling background, center on screen
The WALLPAPER style of background painting currently
draws starting in the upper left corner of each monitor.

This isn't really correct, it means the seam between
monitors doesn't match up and edges look unbalanced if
the tile isn't a multipe of monitor size.

Really, the tiles should be centered in the middle of
the screen.  (Just like when tiling a bathroom floor,
tiles should start in the center of the room.)

This commit reworks the math to make that happen.

https://bugzilla.gnome.org/show_bug.cgi?id=694393
2013-03-02 17:30:32 -05:00
Adel Gadllah
436d3ff8a9 compositor: Make sure we always call the post_paint handlers
Commit 4f2bb583bf started to use a clutter_threads_add_repaint_func_full
callback instead of connecting to the stage's paint signal.

The callback has to return TRUE if it wants to be called again, so fix that
as we want to call it for every frame (otherwise apps supporting the WM SYNC
protocol will stop drawing).

https://bugzilla.gnome.org/show_bug.cgi?id=695006
2013-03-02 18:24:31 +01:00
Adel Gadllah
e4269002ce meta-background-group: Report a paint volume
We never paint outside of the allocation so we can simply use
clutter_paint_volume_set_from_allocation.

https://bugzilla.gnome.org/show_bug.cgi?id=694988
2013-03-02 15:31:10 +01:00
Adel Gadllah
4f2bb583bf compositor: Don't connect to the stage's paint signal
Doing so causes useless full stage redraws and breaks culling
as clutter cannot know how the signal handler affects painting.

So use clutter_threads_add_repaint_func_full with the
CLUTTER_REPAINT_FLAGS_POST_PAINT flag instead.

https://bugzilla.gnome.org/show_bug.cgi?id=694988
2013-03-02 14:42:06 +01:00
Ray Strode
e623406c99 background: Fix gradient color rendering
There is currently code to try to fill gradients in a
hardware native format, using #ifdefs. That optimization is
unimportant since gradients only use 2 byte buffers. It's
also incorrect because it's getting the channel order wrong
at buffer initialization time.

This commit drops the ifdefs for clarity and fixes the
channel order.

https://bugzilla.gnome.org/show_bug.cgi?id=694641
2013-02-28 13:17:24 -05:00
Rico Tzschichholz
1dbefc4e36 compositor/background: Avoid uninitialized variable warning
'code' may be used uninitialized in this function, so make sure
to return early in this case.
2013-02-20 14:02:02 +01:00
Jasper St. Pierre
7f6a77232f compositor: Don't use deprecated Cogl-1.0 API
https://bugzilla.gnome.org/show_bug.cgi?id=694224
2013-02-19 20:05:33 -05:00
Ray Strode
580feb0c85 compositor: rework how backgrounds are managed
Background handling in GNOME is very roundabout at the moment.

gnome-settings-daemon uses gnome-desktop to read the background from
disk into a screen-sized pixmap. It then sets the XID of that pixmap
on the _XROOTPMAP_ID root window property.

mutter puts that pixmap into a texture/actor which gnome-shell then
uses.

Having the gnome-settings-daemon detour from disk to screen means we
can't easily let the compositor handle transition effects when
switching backgrounds. Also, having the background actor be
per-screen instead of per-monitor means we may have oversized
textures in certain multihead setups.

This commit changes mutter to read backgrounds from disk itself, and
it changes backgrounds to be per-monitor.

This way background handling/compositing is left to the compositor.

https://bugzilla.gnome.org/show_bug.cgi?id=682427
2013-02-19 18:21:00 -05:00
Ray Strode
842bc4421c compositor: export actor_is_untransformed function
actor_is_untransformed is a function meta-window-group uses to determine
if an actor is relatively pixel aligned and not contorted. It then
returns the coordinates of the actor.

In a subsequent commit will need the function in a different file, so
this commit separates it out.

https://bugzilla.gnome.org/show_bug.cgi?id=682427
2013-02-19 18:18:29 -05:00
Ray Strode
aba87407e9 compositor: do sync actor stack in one pass
This refactor will simplify a subsequent commit that
introduces more than one background actor to the window
group.

https://bugzilla.gnome.org/show_bug.cgi?id=682427
2013-02-19 16:09:27 -05:00
Jasper St. Pierre
491c5b622e window-actor: Set every window actor to be reactive
Now that the background actor is reactive, this means that
clicks on the window group part of the stage, even when they're
on an X window, will be registered as the background actor, as
all of the other children of the group aren't reactive. This can
happen when a plugin takes a modal grab, for instance.

https://bugzilla.gnome.org/show_bug.cgi?id=681540
2013-02-17 15:43:38 -05:00
Jasper St. Pierre
5e9621ed80 compositor: Spoof events on the guard window
This allows events generated for the guard window to be picked up
by Clutter as if they were events for the mutter stage.

https://bugzilla.gnome.org/show_bug.cgi?id=681540
2013-02-17 15:43:38 -05:00
Jasper St. Pierre
f5de1c78af compositor: Set the background actor to be reactive by default
Combined with the previous patch, this gives us an easy way to
connect for events on the wallpaper.

https://bugzilla.gnome.org/show_bug.cgi?id=681540
2013-02-17 15:43:38 -05:00
Adel Gadllah
034ab77c30 window-actor: Use meta_window_is_monitor_sized
Use meta_window_is_monitor_sized in should_unredirect instead of doing
the checks directly.
2013-02-17 21:42:14 +01:00
Owen W. Taylor
d900d83522 MetaWindowActor: Go back to freezing affecting actor geometry
We do, in fact, need freezing to affect window geometry, so that
move-resize operations (such as an interactive resize from the
left, or a resize of a popup centered by the application) occur
atomically.

So to make map effects work properly, only exclude the initial
placement of a window from freezing. (In the future, we may want
to consider whether pure moves of a window being done in response
to a user drag should also be excluded from freezing.)

Rename meta_window_sync_actor_position() to
meta_window_sync_actor_geometry() for clarity.

https://bugzilla.gnome.org/show_bug.cgi?id=693922
2013-02-15 21:48:25 -05:00
Owen W. Taylor
3d337a98d9 MetaWindowActor: Freeze shouldn't affect actor position
If a window is frozen because it is repainting, that shouldn't kee[p
us from updating its position: we don't want a slow-to-update window
to move around the screen chunkily when dragged. (This does reduce
the efficiency of begin/end frames for replacing double-buffering,
but that never works very well in the case where there was an overlapping
window or the entire screen needed redrawing for whatever reason.)

This fixes a bug where a window that was mapped frozen would not get
positioned properly until after the map effect finished, and would
jump from 0,0 at that point. Since effects *do* need to prevent
actor repositioning by Mutter, we must position the actor before any
effect starts.

Because we now are queuing invalidates on frozen windows, fix the
logic for that so that we properly update everything when the window
unfreezes.

https://bugzilla.gnome.org/show_bug.cgi?id=693922
2013-02-15 16:07:47 -05:00
Owen W. Taylor
5876f2e3e5 Fix corner cases where _NET_WM_FRAME_DRAWN might be missed
The WM spec requires _NET_WM_FRAME_DRAWN to *always* be sent when
there is an appropriate update to the sync counter value. We were
potentially missing _NET_WM_FRAME_DRAWN when an application did a
spontaneous update during an interactive resize and during effects.
Refactor the code to always send _NET_WM_FRAME_DRAWN, even when
a window is frozen.

https://bugzilla.gnome.org/show_bug.cgi?id=693833
2013-02-14 16:21:26 -05:00
Gayan Perera
6b5cf2eb61 compositor: Add a new window group for override-redirect windows
Put override redirect windows such as menus into a separate window group
stacked above everything else. This will allow us to visually put these
above other compositior chrome.

Based on a patch from Muffin.

https://bugzilla.gnome.org/show_bug.cgi?id=633620
2013-02-14 01:25:17 -05:00
Giovanni Campagna
fb0cd80332 compositor: remove the hidden group
It is unused and always empty.

https://bugzilla.gnome.org/show_bug.cgi?id=682427
2013-02-14 01:03:47 -05:00
Owen W. Taylor
87fe9685b5 Distinguish "no delay" frames from spontaneous drawing
When a client is drawing as hard as possible (without sleeping
between frames) we need to draw as soon possible, since sleeping
will decrease the effective frame rate shown to the user, and
can also result in the system never kicking out of power-saving
mode because it doesn't look fully utilized.

Use the amount the client increments the counter value by when
ending the frame to distinguish these cases:

 - Increment by 1: a no-delay frame
 - Increment by more than 1: a non-urgent frame, handle normally

https://bugzilla.gnome.org/show_bug.cgi?id=685463
2013-02-13 09:48:27 -05:00
Owen W. Taylor
2d9b8bb2d0 Send _NET_WM_FRAME_TIMINGS messages
We previously had timestamp information stubbed out in
_NET_WM_FRAME_DRAWN. Instead of this, add a high-resolution timestamp
in _NET_WM_FRAME_DRAWN then send a _NET_WM_FRAME_TIMINGS message
after when we have complete frame timing information, representing
the "presentation time" of the frame as an offset from the timestamp
in _NET_WM_FRAME_DRAWN.

To provide maximum space in the messages,_NET_WM_FRAME_DRAWN and
_NET_WM_FRAME_TIMINGS are not done as WM_PROTOCOLS messages but
have their own message types.

https://bugzilla.gnome.org/show_bug.cgi?id=685463
2013-02-13 09:48:27 -05:00
Owen W. Taylor
74b1a9e2b9 Add meta_compositor_monotonic_time_to_server_time()
Add a function to convert from g_get_monotonic_time() to a
"high-resolution server timestamp" with microsecond precision.
These timestamps will be used when communicating frame timing
information to the client.

https://bugzilla.gnome.org/show_bug.cgi?id=685463
2013-02-13 09:48:27 -05:00
Owen W. Taylor
d8696c17be Use clutter_stage_set_sync_delay()
Using a "sync delay" where we wait for 2 ms after the vblank before
starting to draw the next frame provides for much more predictable
latency for applications. An application can know that if it completes
a frame any time between 8ms before the vblank to the vblank,
it will reliably be drawn on the following vblank period, rather than
having an unpredictable latency depending on whether the compositor
is currently busy drawing a frame or not.

https://bugzilla.gnome.org/show_bug.cgi?id=685463
2013-02-13 09:48:26 -05:00
Owen W. Taylor
b07aea467e Enable CLUTTER / COGL_ENABLE_EXPERIMENTAL_API globally
Instead of defining CLUTTER_ENABLE_EXPERIMENTAL_API and
COGL_ENABLE_EXPERIMENTAL_API in individual source files, enable
them on the command line. We weren't tracking exactly what pieces of
experimental API we were using and we were using the experimental
API in most source files that used Clutter and Cogl, so the
local #defines were annoying rather than useful.

https://bugzilla.gnome.org/show_bug.cgi?id=685463
2013-02-13 09:48:26 -05:00
Owen W. Taylor
04ef448927 Handle _NET_WM_SYNC_REQUEST_COUNTER updates without redraw
It's possible that a client might update the (extended)
_NET_WM_SYNC_REQUEST_COUNTER counter twice without actually drawing
anything. In that case, we still should send a _NET_WM_FRAME_DRAWN
message since it's hard for a client to know every case in which
no damage is generated. For now, do it the easy way by forcing a
stage repaint.

https://bugzilla.gnome.org/show_bug.cgi?id=685463
2013-02-13 09:48:26 -05:00
Owen W. Taylor
fbfab93c63 Send _NET_WM_FRAME_DRAWN messages
When the application provides the extended second counter for
_NET_WM_SYNC_REQUEST, send a client message with completion
information after the next redraw after each counter update
by the application.

https://bugzilla.gnome.org/show_bug.cgi?id=685463
2013-02-13 09:48:26 -05:00
Owen W. Taylor
c9343e3ee3 Implement freezing of updates during resize
Replace the unused meta_compositor_set_updates() with
a reversed-meaning meta_compositor_set_updates_frozen(), and use
it to implement freezing application window updates during
interactive resizing. This avoids drawing new areas of the window
with blank content before the application has a chance to repaint.

https://bugzilla.gnome.org/show_bug.cgi?id=685463
2013-02-13 09:40:07 -05:00
Owen W. Taylor
3abaf506a6 MetaWindowActor: Use guint for bitfields
A 1-bit boolean (int) bitfield has the values 0 and -1. Use
guint instead for bitfield values.

https://bugzilla.gnome.org/show_bug.cgi?id=685463
2013-02-13 09:39:09 -05:00
Adel Gadllah
1c680be11a meta-window-actor: Make sure that the shape_region is always set
Start off with an empty region to make sure that the shape_region is
always set even for unredirected and frozen windows.

https://bugzilla.gnome.org/show_bug.cgi?id=693482
2013-02-09 20:56:03 +01:00
Jasper St. Pierre
453020c315 Make sure to include the old XI2 mask when selecting for events
Some windows may already have event masks on them that we've selected
for, especially if we're using GTK+ windows. In particular, this fixes
window menus in the XI2 port.

https://bugzilla.gnome.org/show_bug.cgi?id=690581
2013-02-07 18:13:40 -05:00
Adel Gadllah
5298d1c8d0 meta-window-actor: Don't do check_needs_reshape when not mapped
This can cause us ending up with a wrong mask because we don't yet
have a pixmap to use in build_and_scan_frame_mask().

https://bugzilla.gnome.org/show_bug.cgi?id=679901
2013-02-06 18:11:36 +01:00
Rico Tzschichholz
493f619adc meta-window-actor: Fix uninitialized variable
Fallout of 90f2a3ae4c
2013-02-06 08:19:20 +01:00
Jasper St. Pierre
a613a55658 Support _NET_WM_OPAQUE_REGION
This new hint allows compositors to know what portions of a window
will be obscured, as a region above them is opaque. For an RGB window,
possible to glean this information from the bounding shape region of
a client window, but not for an ARGB32 window. This new hint allows
clients that use ARGB32 windows to say which part of the window is
opaque, allowing this sort of optimization.

https://bugzilla.gnome.org/show_bug.cgi?id=679901
2013-02-06 00:08:04 -05:00
Jasper St. Pierre
3fe5a676c2 window-actor: Remove the bounding region
With the shape region always set, it turns out the bounding region
is only used in one place, that's easily replaced with a variable
we already have available to us.

https://bugzilla.gnome.org/show_bug.cgi?id=679901
2013-02-06 00:05:23 -05:00
Jasper St. Pierre
19420f147f window-actor: Remove conditional checks for the shape region
With recent changes in the way the window mask texture is constructed,
the shape_region is always set, which means that we can remove
conditionals checking if the shape region is set.

https://bugzilla.gnome.org/show_bug.cgi?id=679901
2013-02-06 00:05:23 -05:00
Jasper St. Pierre
d48df249c9 Revert "window-actor: Ensure we always have a valid shape_region"
This reverts commit 07273a075d.
2013-02-06 00:02:03 -05:00
Jasper St. Pierre
e48c3dac87 Revert "window-actor: Remove conditional checks for the shape region"
This reverts commit 84930f1d78.
2013-02-06 00:02:02 -05:00
Jasper St. Pierre
3516902fae Revert "window-actor: Remove the bounding region"
This reverts commit 66185a468c.
2013-02-06 00:02:00 -05:00
Jasper St. Pierre
66185a468c window-actor: Remove the bounding region
With the shape region always set, it turns out the bounding region
is only used in one place, that's easily replaced with a variable
we already have available to us.

https://bugzilla.gnome.org/show_bug.cgi?id=679901
2013-02-05 23:59:20 -05:00
Jasper St. Pierre
84930f1d78 window-actor: Remove conditional checks for the shape region
With recent changes in the way the window mask texture is constructed,
the shape_region is always set, which means that we can remove
conditionals checking if the shape region is set.

https://bugzilla.gnome.org/show_bug.cgi?id=679901
2013-02-05 23:54:13 -05:00
Jasper St. Pierre
07273a075d window-actor: Ensure we always have a valid shape_region
Force a reshape at startup to ensure that shape_region is always
constructed and valid, even if the window is unredirected or frozen.

https://bugzilla.gnome.org/show_bug.cgi?id=679901
2013-02-05 23:54:13 -05:00
Adel Gadllah
90f2a3ae4c mutter-window-actor: Improve unredirect heuristic
Currently we only unredirect monitor sized override redirect windows.
This was supposed to catch fullscreen opengl games and improve
their performance.

Newer games like fullscreen webgl games and SDL2 using games (like L4D) as well as wine based games do not use override redirect windows so we need a better
heuristic to catch them.

GLX windows always damage the whole window when calling glxSwapBuffers and
never damage sub regions. So we can use that to detect them.

The new heuristic unredirects windows fullscreen windows that have damaged the
whole window more then 100 times in a row.

https://bugzilla.gnome.org/show_bug.cgi?id=683786
2013-02-05 21:13:27 +01:00
Adel Gadllah
2ecc50af53 meta-window-actor: Correctly create a new pixmap when redirecting a window again
We should call meta_window_actor_detach not
meta_window_actor_queue_create_pixmap to create a new pixmap when we redirect a
previously unredirected window again.

https://bugzilla.gnome.org/show_bug.cgi?id=693042
2013-02-02 11:02:49 +01:00
Jasper St. Pierre
e28a36affd window-actor: Merge two simple methods
With some recent changes to how mask textures are constructed from
shapes, a helper method we made was only called in one place, allowing
us to drop a reference/destroy, and remove a double clear.

https://bugzilla.gnome.org/show_bug.cgi?id=679901
2013-01-18 00:28:54 -05:00
Jasper St. Pierre
53534b4ded window-actor: Remove custom region destruction methods with g_clear_pointer
https://bugzilla.gnome.org/show_bug.cgi?id=679901
2013-01-18 00:28:54 -05:00
Jasper St. Pierre
079dd60e3d window-actor: Clean up finalization code with simple uses of g_clear_pointer
While not a massive change by itself, adding new code to use g_clear_pointer
without porting existing usage looks strange.

https://bugzilla.gnome.org/show_bug.cgi?id=679901
2013-01-18 00:28:54 -05:00
Jasper St. Pierre
5d12f00b3b window-actor: Speed up mask creation
Due to a conditional error, meta_region_builder_add_rectangle was called
on every single blank pixel, rather than at the end of spans. With the new
rename, it's fairly clear to see the error. Fix the check to ensure that
we no longer make extraneous calls to meta_region_builder_add_rectangle.

https://bugzilla.gnome.org/show_bug.cgi?id=691874
2013-01-17 16:33:54 -05:00
Jasper St. Pierre
95f3bb3b81 window-actor: Rename variable in scanning function
"w" usually stands for "width", but here it stands for the end X bound,
so we'll rename it to the more traditional "x2".

https://bugzilla.gnome.org/show_bug.cgi?id=691874
2013-01-17 16:33:53 -05:00
Jasper St. Pierre
9596c24f83 plugin-manager: Remove a bogus check
We dereference the plugin_mgr in the initializer above,
so it's wrong.

https://bugzilla.gnome.org/show_bug.cgi?id=690609
2013-01-09 14:06:24 -05:00
Jasper St. Pierre
66d37e06ba compositor: Remove unused code fetching _XSETROOT_ID
We don't use this atom anywhere, so don't bother fetching it.

https://bugzilla.gnome.org/show_bug.cgi?id=691363
2013-01-08 15:54:50 -05:00
Adel Gadllah
3876a1a192 Support bypass compositor hints
Add support for _NET_WM_BYPASS_COMPOSITOR and _NET_WM_DONT_BYPASS_COMPOSITOR
as proposed here: https://mail.gnome.org/archives/wm-spec-list/2012-February/msg00010.html

https://bugzilla.gnome.org/show_bug.cgi?id=683020
2012-12-18 19:02:34 +01:00
Jasper St. Pierre
6139bc77ec Remove support for Core Events
https://bugzilla.gnome.org/show_bug.cgi?id=688779
2012-12-13 18:15:23 -05:00
Jasper St. Pierre
774ceec243 Select for XI2 events everywhere else
In random places that are not grabs, we selected for events on
things like the root window, stage window, COW and more. Switch
these over to using the proper XI2 APIs.

https://bugzilla.gnome.org/show_bug.cgi?id=688779
2012-12-13 17:14:06 -05:00
Jasper St. Pierre
8931b8026e compositor: Identify XI2 events as grabbed events
https://bugzilla.gnome.org/show_bug.cgi?id=688779
2012-12-13 16:36:43 -05:00
Jasper St. Pierre
55251aa986 compositor: Use XInput2 to grab the pointer/keyboard
https://bugzilla.gnome.org/show_bug.cgi?id=688779
2012-12-13 16:36:42 -05:00
Giovanni Campagna
e73946f0bf MetaBackgroundActor: add a setter for GLSL uniforms
It doesn't make sense to GLSL shaders without uniforms.

https://bugzilla.gnome.org/show_bug.cgi?id=682536
2012-11-17 02:14:38 +01:00
Florian Müllner
424fc5245a Add compositor hook to process keybindings selectively
Currently keybindings are blocked while the compositor holds a grab; if
we want a keybinding to be available anyway, we use captured ClutterEvents
to determine the KeyBindingAction the event would have triggered and
run our own handlers (ugh).
Instead, provide a hook to allow the compositor to filter out keybindings
before processing them normally, regardless of whether the compositor
holds a grab or not.

https://bugzilla.gnome.org/show_bug.cgi?id=688202
2012-11-17 01:47:05 +01:00
Rui Matos
c37c741592 meta-background-actor: Fix compilation error 2012-11-05 19:44:03 +01:00
Giovanni Campagna
859ea1457d Add the ability to add shader hooks to MetaBackgroundActor
Using ClutterEffect is not pratical on MetaBackgroundActor, as the FBO
redirection has a noticeable performance impact. Instead, allow adding
GLSL code directly to the pipeline used to draw the background texture.
At the same time, port MetaBackgroundActor to modern Cogl API.

https://bugzilla.gnome.org/show_bug.cgi?id=669798
2012-11-05 19:12:37 +01:00
Owen W. Taylor
f258556cec MetaPluginManager: don't send events to Clutter twice
When support for multiple plugins was removed, the logic that was
supposed to send events to Clutter directly *only if there is no filter
function from a plugin* was broken, so events were being sent to
Clutter twice if Clutter didn't consume them the first time.

https://bugzilla.gnome.org/show_bug.cgi?id=686406
2012-11-03 19:36:41 -04:00
Jasper St. Pierre
7938458eb8 window-actor: Don't create a mask texture unnecessarily
Mask texture resources may be expensive. Don't create one
if we don't need to, like on an unshaped window without
a frame.

https://bugzilla.gnome.org/show_bug.cgi?id=681676
2012-09-26 13:53:14 -03:00
Florian Müllner
0371194191 window-group: Add missing cast 2012-09-04 09:10:35 +02:00
Florian Müllner
3b0c7c568d window-group: Remove unused variables 2012-09-04 08:56:48 +02:00
Jasper St. Pierre
bc96a14185 window-group: Subtract the unredirected window in stage space
meta_window_group_paint tries to carefully figure out which parts of the
scene it can avoid painting. One area it avoids painting is the region of
the screen occupied by an unredirected window (if there's one present).
When subtracting from the visible region, it gets the coordinate spaces
confused, and ends up subtracting the area at the wrong offset. Fix this
by translating the rectangle subtracted from the visible region.

https://bugzilla.gnome.org/show_bug.cgi?id=677116
2012-08-29 15:38:53 -03:00
Jasper St. Pierre
fbcddbcf3e window-group: Skip the unredirected window
We shouldn't need to process it here.

https://bugzilla.gnome.org/show_bug.cgi?id=677116
2012-08-29 15:23:06 -03:00
Jasper St. Pierre
dfe8979a90 window-group: Don't create a region when we have an unredirected window
We don't do anything with it other than modify an existing region.

https://bugzilla.gnome.org/show_bug.cgi?id=677116
2012-08-29 15:06:09 -03:00
Jasper St. Pierre
d8bc7f7aa1 window-actor: Fix a memory leak
We need to free the frame_paint_region here.

https://bugzilla.gnome.org/show_bug.cgi?id=682648
2012-08-25 05:51:01 -03:00
Owen W. Taylor
7a2a6e2675 MetaWindowGroup: Fix bad merge
I accidentally committed merge indicators: fix compilation.
2012-08-15 22:46:23 -04:00
Owen W. Taylor
c27b4b7cfc MetaWindowGroup: Handle painting inside a ClutterClone
Look at the current COGL model-view matrix and use that to find
out any offset we are painting at as a result of being inside
a ClutterClone.

https://bugzilla.gnome.org/show_bug.cgi?id=681953
2012-08-15 20:43:19 -04:00
Owen W. Taylor
0ab572d511 MetaWindowGroup: fix logic for handling translations
Instead of getting the x/y of the MetaBackgroundActor with respect to the
parent, use the same logic that we do for windows, fixing the case
where there is a more complex transformation involved.

https://bugzilla.gnome.org/show_bug.cgi?id=681221
2012-08-15 20:43:07 -04:00
Florian Müllner
4e2c2cb1ab shadows: Adjust values for attached modal dialogs
The designers consider the current shadow too dramatic for the new
centered position; adjust the shadow to use the same values as
popup menus.
2012-08-10 16:36:26 +02:00
Tom Beckmann
cd0870730f window-group: Translate background's visible region as necessary
Currently when the window group is moved, the visible region set
on the background actor no longer matches the actually visible
region, resulting in flickering around window actors.
Fix by translating the visible region with the window group.

https://bugzilla.gnome.org/show_bug.cgi?id=681221
2012-08-07 01:28:09 +02:00
Florian Müllner
1a5132d391 shadow-factory: Don't use a top-fade on attached modals
https://bugzilla.gnome.org/show_bug.cgi?id=674499
2012-07-14 03:30:56 +02:00
Jasper St. Pierre
a2f2e07e9b meta-window-actor: Fix a potential crash in the window shaping code
There was a potential case where we were trying to use uninitialized memory,
in the case where the X server threw an error during XShapeGetRectangles.
In this case, we need to use the implicit shape for the window, which means
we need to rearrange code flow to make it work.

https://bugzilla.gnome.org/show_bug.cgi?id=677977
2012-06-25 14:07:35 -04:00
Jasper St. Pierre
f5e48223c9 meta-plugin-manager: Guard against a NULL start vfunc
The default plugin has no such vfunc.

https://bugzilla.gnome.org/show_bug.cgi?id=678238
2012-06-25 13:52:47 -04:00
Jasper St. Pierre
66eac7824a meta-window-actor: Don't unredirect shaped windows
If a window has its BoundingRegion shaped, we shouldn't unredirect it,
as it expects the rest of the windows from being shown under it. This
prevents applications like the Skype screen recorder or gtkRecordMyDesktop
which want to show a "border" around the recorded area from being
unredirected, giving the appearance of making the desktop freeze.

https://bugzilla.gnome.org/show_bug.cgi?id=677657
2012-06-08 16:48:43 -04:00
Jasper St. Pierre
4041f96ed3 meta-window-actor: Refactor should_unredirect a bit more
"Flat is better than nested"

https://bugzilla.gnome.org/show_bug.cgi?id=677657
2012-06-08 16:48:42 -04:00
Jasper St. Pierre
f9454e29db meta-plugin-manager: Only allow one plugin to be loaded
The "multiple plugins loaded at once" strategy was always a big fiction:
while it may be viable if you're super careful, it's fragile and requires
a bit of infrastructure that we would be better off without.

Note that for simplicity, we're keeping the MetaPluginManager, but it only
manages one plugin. A possible future cleanup would be to remove it entirely.

https://bugzilla.gnome.org/show_bug.cgi?id=676855
2012-06-05 13:28:23 -04:00
Jasper St. Pierre
574c0c3287 meta-plugin: Remove "disabled" feature
It's just code cruft that nobody's using

https://bugzilla.gnome.org/show_bug.cgi?id=676855
2012-06-05 13:28:23 -04:00
Jasper St. Pierre
9fa5aa9889 meta-plugin: Kill off "features"
We already check that the plugin has the appropriate vfunc in the klass
structure, so we shouldn't need to check for the same data again with
a "features" long.

https://bugzilla.gnome.org/show_bug.cgi?id=676855
2012-06-05 13:28:23 -04:00
Jasper St. Pierre
7c1b734053 meta-plugin: Remove some cruft
https://bugzilla.gnome.org/show_bug.cgi?id=676855
2012-06-05 13:28:23 -04:00
Jasper St. Pierre
30bc8bc6ce window-actor: Add a debugging tool to write a region to a PNG
Just a helper function that I keep rewriting all over the place.

https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-25 17:31:06 -04:00
Jasper St. Pierre
ac18f41ed1 window-actor: Use MetaRegionBuilder when scanning the visible region
This gives a pretty solid performance improvement when resizing windows.
2012-05-25 17:31:06 -04:00
Jasper St. Pierre
60c05a0dac window-actor: Add back antialiased window corners
This simply adds fancy arcs to the mask texture. It's still not painted
with GTK+ yet.

https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-25 17:31:05 -04:00
Jasper St. Pierre
c47de98c88 window-actor: Paint the shape region with cairo
https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-21 16:12:30 -04:00
Jasper St. Pierre
f1aada0fae window-actor: Punt mask generation to MetaWindowActor
This effectively makes MetaShapedTexture not a MetaShapedTexture, but a simple
and dumb MetaMaskedTexture, with an optimization for clipped regions.

We're doing this as the mask may need to be more complicated than made of
a cairo path -- we eventually want GTK+ to draw the entire frame background,
which we'll then scan.

https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-21 16:12:30 -04:00
Jasper St. Pierre
4de492eb20 shaped-texture: Remove the cairo overlay (and rounded corners)
As we want GTK+ to paint the mask on an A8, we can't simply use a cairo
path. A later commit will make this into a simple masked texture, and
meta-window-actor will be in control of the mask.

https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-21 16:12:30 -04:00
Jasper St. Pierre
9ca00d5cce window-actor: Remove an unnecessary frame check
meta_frame_calc_borders will zero out the borders if we don't have a frame.

https://bugzilla.gnome.org/show_bug.cgi?id=676052
2012-05-21 16:12:30 -04:00
Jasper St. Pierre
878b1012b4 window-actor: Another simple clang warning fix
If we explicitly check for a NULL pointer, clang will assume
that the pointer may be NULL at some point. We clearly rely
on the pointer being non-NULL earlier, so fix this guy up.

https://bugzilla.gnome.org/show_bug.cgi?id=674876
2012-05-01 18:25:33 -04:00
Owen W. Taylor
ba4f008d40 meta_window_actor_has_shadow: remove verbosity
meta_window_actor_has_shadow() is called for every paint for every
window, verbosely logging in it makes the output of MUTTER_VERBOSE
pretty much useless.
2012-05-01 11:37:23 -04:00
Jasper St. Pierre
ebf8c460e1 default plugin: Remove start method that does nothing
All animations use the constants directly, so this is just declaring
a bunch of local variables and then doing nothing with it.

Another clang warning.

https://bugzilla.gnome.org/show_bug.cgi?id=674876
2012-04-26 15:07:46 -04:00
Jasper St. Pierre
25d3432eee window-group: Remove an unnecessary assignment
Clang warns about this.

https://bugzilla.gnome.org/show_bug.cgi?id=674876
2012-04-26 15:07:46 -04:00
Jasper St. Pierre
cd7a74fbcd texture-tower: Remove potential leak
The expression in here does not match the one where we malloc the
data.

https://bugzilla.gnome.org/show_bug.cgi?id=674876
2012-04-26 10:02:41 -04:00
Neil Roberts
ed358c8f4b meta-texture-rectangle: Use Cogl's API to create a rectangle texture
Cogl now has public experimental API to create a rectangle texture
which we can use instead of creating a foreign texture with GL. This
avoids Mutter depending on Cogl including a GL header from its public
headers which it might not do in future.

https://bugzilla.gnome.org/show_bug.cgi?id=672711
2012-04-25 14:54:09 +01:00
Robert Bragg
a22859a64a shaped-texture: never slice shape mask texture
Since Cogl doesn't support multi-texturing with sliced textures and the
shape texture is combined with the texture-from-pixmap texture we need
to make sure we never construct a sliced mask texture. This patch simply
passes the COGL_TEXTURE_NO_SLICE flag to cogl_texture_from_data when
creating the shape mask texture.

https://bugzilla.gnome.org/show_bug.cgi?id=674731
2012-04-25 11:57:33 +01:00
Jasper St. Pierre
c0b4d68390 meta-window-actor: Remove some unused constants
https://bugzilla.gnome.org/show_bug.cgi?id=671104
2012-04-24 16:54:49 -04:00
Jasper St. Pierre
e389eff79d Remove meta_compositor_update_workspace_geometry
This callback is just dead code

https://bugzilla.gnome.org/show_bug.cgi?id=671104
2012-04-24 16:54:49 -04:00
Jasper St. Pierre
044d58951e Switch to gtk-doc syntax
https://bugzilla.gnome.org/show_bug.cgi?id=673752
2012-04-24 15:20:39 -04:00
Giovanni Campagna
3aad30143c default plugin: use the right type for varargs
Coordinates in Clutter are double, so twice the size of an int, and
if not correctly casted memory corruption occurs.

https://bugzilla.gnome.org/show_bug.cgi?id=673809
2012-04-10 03:45:25 +02:00
Owen W. Taylor
c8b4939c7e Fix uninstalling default.so
We need a clean uninstall for 'make distcheck' to pass; libtool
hijinks leave a left-over plugins/default.so - remove it manually.
2012-03-26 14:23:19 -04:00
Jasper St. Pierre
8c1b2d5eda Simplify the frame testing logic in callers to grab borders
A lot of code did something similar to:

  MetaFrameBorders borders;

  if (window->frame)
    meta_frame_calc_borders (window->frame, &borders);
  else
    meta_frame_borders_clear (&borders);

Sometimes, the else part was omitted and we were unknowingly using
uninitalized values for OR windows. Clean this up by just testing
for a NULL frame in meta_frame_calc_borders and clearing for the
caller if so.

https://bugzilla.gnome.org/show_bug.cgi?id=643606
2012-03-17 06:40:54 -04:00
Rui Matos
a8ead4d447 MetaWindowActor: don't draw shadows for tiled windows with a match
The shadow between 2 tiled windows ruins the visual tiles effect.

https://bugzilla.gnome.org/show_bug.cgi?id=643075
2012-03-16 19:12:10 +01:00
Damien Radtke
04bf73ff6d default plugin: animate minimization to icon geometry
Instead of minimizing windows in place, minimize them to the icon
geometry for the window (if set), or to the upper-left corner if
it's not set.

https://bugzilla.gnome.org/show_bug.cgi?id=667437
2012-03-13 13:53:05 -04:00
Rui Matos
3f3e3ce37e plugins/default: Fix compiler error 2012-03-09 14:05:28 +01:00
Jasper St. Pierre
5e3d93da87 plugin: Remove unneeded wrapper APIs
Mutter originally started out with the idea that only a subset of the total
API was exposed to plugins, so some APIs are duplicated on MutterPlugin.
We've long since abandoned that idea; remove these wrappers.

https://bugzilla.gnome.org/show_bug.cgi?id=671103
2012-03-08 16:52:44 -05:00
Robert Bragg
d249cfd040 Pass CoglContext to cogl_texture_pixmap_x11_new()
The experimental Cogl api cogl_texture_pixmap_new() was recently changed
so it now expects an explicit CoglContext argument and it can also
return exceptions now via a GError. This patch updates mutters use of
the api accordingly.
2012-02-21 18:23:22 +00:00
Adel Gadllah
3cb912aee2 MetaShapedTexture: Implement get_paint_volume
Add a get_paint_volume implementation to MetaShapedTexture.
2012-02-21 18:09:25 +01:00
Jasper St. Pierre
0dab6df25a configure: Require Clutter 1.9.10
We depend on API introduced in Clutter 1.9.10. Additionally, remove
a compatibility fallback that isn't needed anymore.
2012-02-16 16:44:03 -05:00
Jasper St. Pierre
c844bab232 meta-background-actor: Chain up in dispose
This was preventing Clutter from running its dispose, preventing
it from being destroyed correctly. While a major bug and possibly
big memory leak, the most obvious effect was the message that Clutter
spat out:

  Clutter-CRITICAL **: clutter_actor_iter_next: assertion `ri->age == ri->root->priv->age' failed

Since we never disposed the actor correctly, it was never removed
from its parent, and the age wasn't updated correctly.
2012-02-16 16:29:33 -05:00
Jasper St. Pierre
7319b10d72 MetaShapedTexture: Remove visible_pixels_region
When we were shaping the window with a cairo region, there was an easy
optimization to restrict painting only to the pixels we were going to
actually draw. With rounded corners, the amount of work we have to do
figure out what pixels isn't worth the small savings of not drawing the
completely transparent parts of the corners, so remove this optimization,
and the supporting meta_shaped_texture_get_visible_pixels_region()

https://bugzilla.gnome.org/show_bug.cgi?id=657639
2012-02-03 19:58:21 -05:00
Jasper St. Pierre
1265efcf78 MetaShapedTexture: Add a new method to flatten the shaped texture into pixels
This will be used by the Shell to implement a screenshot_window method.

https://bugzilla.gnome.org/show_bug.cgi?id=660941
2012-02-03 19:57:38 -05:00
Jasper St. Pierre
3e0ef03fd9 MetaShapedTexture: Make public and directly derive from ClutterActor
ClutterTexture has many features that we simply don't use and don't make
sense for a subclass with custom drawing. Deriving directly from ClutterActor
simplifies our code by avoiding workarounds and makes things more robust.

Additionally, make it public. GNOME Shell was already assuming that any
MetaShapedTexture was also a ClutterTexture, and we need to replace these
bits with new API for GNOME Shell to use.

https://bugzilla.gnome.org/show_bug.cgi?id=660941
2012-02-03 15:35:41 -05:00