1
0
Fork 0
Commit graph

1335 commits

Author SHA1 Message Date
Jonas Ådahl
10a0114856 wayland: Move buffer use count to MetaWaylandSurface
Each wl_surface.commit with a newly attached buffer should result in
one wl_buffer.release for the attached buffer. For example attaching
the same buffer to two different surfaces must always result in two
wl_buffer.release events being emitted by the server. The client is
responsible for counting the wl_buffer.release events and be sure to
have received as many release events as it has attached and committed
the buffer, before reusing it.

https://bugzilla.gnome.org/show_bug.cgi?id=762828
2016-03-29 18:26:10 +08:00
Jasper St. Pierre
190357c561 surface-actor-x11: Unredirect ARGB32 windows with full opaque regions
We can detect that these windows are already fully opaque, so allow them
to unredirect. Allows unredirecting Totem during video playback, giving
a significant speed boost.
2016-03-21 13:44:44 -07:00
Rui Matos
ca1b4382c0 shaped-texture: Invalidate mask texture when main texture changes size
We currently rely only on MetaWindowActor to update the mask
texture. This isn't good enough since we might get asked to use the
mask (e.g. via meta_shaped_texture_get_image() ) after having a new
texture size but before MetaWindowActor decides to update the mask in
which case we might crash since cogl_texture_new_from_sub_texture()
might fail with an early return such as

Cogl-CRITICAL **: cogl_sub_texture_new: assertion 'sub_x + sub_width
<= next_width' failed

https://bugzilla.gnome.org/show_bug.cgi?id=762639
2016-03-10 15:56:41 +01:00
Jonas Ådahl
99bba9e56c bell: Flash whole window if the window had no frame
CSD X11 clients and Wayland clients don't have a window frame drawn by
the compositor to flash. So instead of flashing the whole screen when
configured to just flash the window, flash just the window region.

https://bugzilla.gnome.org/show_bug.cgi?id=763284
2016-03-10 12:34:56 +08:00
Jonas Ådahl
020ae58fe4 wayland: Add "painting" signal to surface actor
Make MetaWaylandSurface a listener and move output state updating to
the handler function.

https://bugzilla.gnome.org/show_bug.cgi?id=744104
2016-02-16 19:02:48 +08:00
Florian Müllner
46eb682c83 Revert "window: Remove old tiling code"
This reverts commit 8bded7d497.
2016-01-10 15:16:09 +01:00
Jasper St. Pierre
8bded7d497 window: Remove old tiling code
We'll soon replace this with a better scheme

https://bugzilla.gnome.org/show_bug.cgi?id=751857
2016-01-09 18:08:32 -08:00
Lionel Landwerlin
0e8ca1a042 default-plugin: port to non deprecated API
https://bugzilla.gnome.org/show_bug.cgi?id=759374
2015-12-15 08:39:57 +00:00
Cosimo Cecchi
377ecdb864 compositor: pass correct parameter to meta_window_actor_size_change()
We were always passing the parameter for a maximize animation.
2015-10-12 15:39:51 -04:00
Jasper St. Pierre
b975676c5d window-actor: Draw shadows around some CSD windows
Some windows, like Chromium and Steam, are technically CSD in that they
don't want a system titlebar and draw their own, but we should still
provide them with a shadow.
2015-10-07 12:09:30 -07:00
Olivier Fourdan
443d579d40 wayland: do not crash if the surface is gone
If a queued event is being processed after the surface is
destroyed, trying to access the window associated with the surface
will lead to a segmentation fault.

This patch avoids the crash by first checking if the surface is not null.

https://bugzilla.gnome.org/show_bug.cgi?id=754715
2015-09-09 09:30:14 +02:00
Ting-Wei Lan
0aa4c4d43e build: Fix return value in meta-background.c
https://bugzilla.gnome.org/show_bug.cgi?id=754545
2015-09-04 11:47:34 +08:00
Ray Strode
1d56d50fcd background: paint color matte for scaled and centered backgrounds
Some backgrounds don't fully fill the screen.  For those backgrounds
it's important to paint a color behind them to fill in the gaps.

This commit checks whether or not the background image textures take
up the entire monitor, and in the event they don't, draws a color
behind them (such as it would do if the background were
translucent).

https://bugzilla.gnome.org/show_bug.cgi?id=754476
2015-09-03 15:14:15 -04:00
Ray Strode
0ffd4254d9 background: simplify conditional in meta_background_get_texture
meta_background_get_texture only draws the bottom image texture
if
   1) the blend factor leaves the top image translucent
   or
   2) the top image is translucent from alpha

The latter case doesn't actually matter since we're using REPLACE
on the top image texture.

This commit drops the unnecessary check for the second case and
applies demorgans law to the conditional for clarity.

https://bugzilla.gnome.org/show_bug.cgi?id=754476
2015-09-03 15:14:15 -04:00
Rui Matos
299ed424d3 compositor: Handle fences in the frontend X connection
Since mutter has two X connections and does damage handling on the
frontend while fence triggering is done on the backend, we have a race
between XDamageSubtract() and XSyncFenceTrigger() causing missed
redraws in the GL_EXT_X11_sync_object path.

If the fence trigger gets processed first by the server, any client
drawing that happens between that and the damage subtract being
processed and is completely contained in the last damage event box
that mutter got, won't be included in the current frame nor will it
cause a new damage event.

A simple fix for this would be XSync()ing on the frontend connection
after doing all the damage subtracts but that would add a round trip
on every frame again which defeats the asynchronous design of X
fences.

Instead, if we move fence handling to the frontend we automatically
get the right ordering between damage subtracts and fence triggers.

https://bugzilla.gnome.org/show_bug.cgi?id=728464
2015-08-13 14:14:46 +02:00
Adel Gadllah
038f828ab1 SurfaceActorWayland: Destroy frame callbacks when the surface gets destroyed
https://bugzilla.gnome.org/show_bug.cgi?id=739163
2015-08-09 19:25:46 +02:00
Ting-Wei Lan
b0b08d5010 build: Fix return value in meta-sync-ring.c
https://bugzilla.gnome.org/show_bug.cgi?id=753380
2015-08-09 17:49:57 +08:00
Adel Gadllah
070cd27786 wayland: Only call frame callbacks when a surface gets drawn on screen
The spec says:
"A server should avoid signalling the frame callbacks if the surface is not
visible in any way, e.g. the surface is off-screen, or completely obscured
by other opaque surfaces."

We actually do have the information to do that but we are always calling
the frame callbacks in after_stage_paint. So fix that to only call when
when the surface gets drawn on screen.

https://bugzilla.gnome.org/show_bug.cgi?id=739163
2015-08-09 10:40:40 +02:00
Aaron Plattner
9df6cda3e3 compositor: Fix GL_EXT_x11_sync_object race condition
The compositor maintains a ring of shared fences with the X server in order to
properly synchronize rendering between the X server and the compositor's GPU
channel.  When all of the fences have been used, the compositor needs to reset
one so that it can be reused.  It does this by first waiting on the CPU for the
fence to become triggered, and then sending a request to the X server to reset
the fence.

If the compositor's GPU channel is busy processing other work (e.g. the desktop
switcher animation), then the X server may process the reset request before the
GPU has consumed the fence.  This causes the GPU channel to hang.

Fix the problem by having the compositor's GPU channel trigger its own fence
after waiting for the X server's fence.  Wait for that fence on the CPU before
sending the reset request to the X server.  This ensures that the GPU has
consumed the X11 fence before the server resets it.

Signed-off-by: Aaron Plattner <aplattner@nvidia.com>

https://bugzilla.gnome.org/show_bug.cgi?id=728464
2015-08-07 17:27:42 +02:00
Rui Matos
39763d4add compositor: Add support for GL_EXT_x11_sync_object
If GL advertises this extension we'll use it to synchronize X with GL
rendering instead of relying on the XSync() behavior with open source
drivers.

Some driver bugs were uncovered while working on this so if we have
had to reboot the ring a few times, something is probably wrong and
we're likely to just make things worse by continuing to try.  Let's
err on the side of caution, disable ourselves and fallback to the
XSync() path in the compositor.

https://bugzilla.gnome.org/show_bug.cgi?id=728464
2015-08-07 17:27:42 +02:00
Jonas Ådahl
ac79988939 wayland: Handle unsetting of input and opaque surface region
When a client sets an input region or a opaque region to NULL, it
should still be considered a change to the corresponding region on the
actor. This patch makes sure this state is properly forwarded.

https://bugzilla.gnome.org/show_bug.cgi?id=753222
2015-08-05 10:22:49 +08:00
Florian Müllner
124888764d default-plugin: Replace deprecated macro 2015-07-22 16:01:13 +02:00
Matthias Clasen
ad51c52b69 feedback actor: Fix a typo
The code for setting an anchor was comparing apples and oranges.
This was pointed out by coverity.

https://bugzilla.gnome.org/show_bug.cgi?id=752552
2015-07-20 17:39:09 -04:00
Jonas Ådahl
f01247d815 wayland: Fix calculation of window geometry when scaled
Take the surface actor scale into account when calculating the window
geometry.

https://bugzilla.gnome.org/show_bug.cgi?id=744934
2015-07-16 11:54:14 +08:00
Jonas Ådahl
3b993131e8 wayland: Fix subsurface positioning on HiDPI
Keep the active position state in its original coordinate space, and
synchronize the surface actor with it when it changes and when
synchronizing the rest of the surface state, in case the surface scale
had changed.

https://bugzilla.gnome.org/show_bug.cgi?id=745655
2015-07-16 11:43:19 +08:00
Jonas Ådahl
117f57f74c wayland: Factor out some parts of meta_surface_actor_wayland_get_scale
Put a toplevel window getter in meta-wayland-surface.h and a main
monitor scale getter in window-wayland.h.

https://bugzilla.gnome.org/show_bug.cgi?id=745655
2015-07-16 11:43:19 +08:00
Jonas Ådahl
5d10196919 MetaSurfaceActorWayland: Don't dereference surface before NULL check
Fixes regression introduced in ba7c524a18.

https://bugzilla.gnome.org/show_bug.cgi?id=744453
2015-07-15 17:10:48 +08:00
Jonas Ådahl
eb023ff2c9 wayland: Send wl_surface.enter and wl_surface.leave
Whenever a MetaSurfaceActor is painted, update the list of what outputs
the surface is being drawed upon. Since we do this on paint, we
effectively avoids this whenever the surface is not drawn, for example
being minimized, on a non-active workspace, or simply outside of the
damage region of a frame.

DND icons and cursors are not affected by this patch, since they are not
drawn as MetaSurfaceActors. If a MetaSurfaceActor or a parent is cloned,
then we'll check the position of the original actor again when the clone is
drawn, which is slightly expensive, but harmless. If the MetaShapedTexture
instead is cloned, as GNOME Shell does in many cases, then these clones
will not cause duplicate position checks.

https://bugzilla.gnome.org/show_bug.cgi?id=744453
2015-07-15 14:55:55 +08:00
Jonas Ådahl
ba7c524a18 MetaSurfaceActorWayland: Unset the MetaWaylandSurface pointer when it goes away
We may access it during painting even if it has been freed. For now,
manually unset it during the MetaWaylandSurface cleanup; in the future
make MetaWaylandSurface a GObject and make the surface pointer a weak
reference.

https://bugzilla.gnome.org/show_bug.cgi?id=744453
2015-07-15 14:55:55 +08:00
Jasper St. Pierre
a191554cf6 compositor: Export meta_shadow_factory_get_shadow to introspection
I forgot we had a separate list of headers for introspection to scan.
2015-07-06 00:27:03 -07:00
Jasper St. Pierre
b33a82eb7c Export the shadow factory
The elementary guys would like this as an API, and I don't see any
reason to refuse -- this is quite nice shadow painting code :)

For some reason, gobject-introspection can't seem to cope with
MetaWindowShape. I'll look into it a bit later, but for now, mark
the function it has trouble with as (skip).
2015-07-06 00:14:22 -07:00
Jasper St. Pierre
2705c87f74 window-group: Fix issues when translated
It seems that when translated, paint_offset and actor_offset will always
be the same, so our translation of the clip group won't work. For now,
until I figure out what's going on here, just use the painting offset,
since that what seems to make sense to me.

I didn't write this code, though, so I don't know why the actor's
allocation was involved in this computation at all.

I tested briefly with clones (magnifier, manual cloning through the
looking glass) and couldn't find any other artifacts, so I'm going to do
this for now.
2015-07-05 23:55:43 -07:00
Jasper St. Pierre
9fc1c919e8 window-actor: Replace no-shadow with a shadow-mode
The elementary guys want to be able to force shadows *on*, for use in
their overview.
2015-07-05 23:29:11 -07:00
Jasper St. Pierre
9f04c58ffe Implement a generic "size change" mechanism
A much less hacky version of maximize / unmaximize is reimplemented
in terms of this, but it could also eventually be used for fullscreen /
unfullscreen, and tile / untile.
2015-07-05 23:03:36 -07:00
Jasper St. Pierre
7de1f3a7be plugin-manager: Make the event an enum 2015-07-05 22:01:59 -07:00
Jasper St. Pierre
fd443ecf2a plugin-manager: Clean up an unused define 2015-07-05 22:01:59 -07:00
Jasper St. Pierre
e8dd5601e7 window-group: Turn clipped redraws back on
Whoops -- I commented this out for debugging reasons.
2015-07-05 19:19:33 -07:00
Jasper St. Pierre
ccca810daf window-group: Improve performance by hacking around Clutter
The comment explains it better, but Clutter tries to be smart and
repaint actors when their allocations change. Since the window group's
allocation changes when windows move around, this means that moving a
window will always cause a full-stage repaint, which is super slow.

Hack around this for now.
2015-07-05 19:18:22 -07:00
Jasper St. Pierre
693456b644 shaped-texture: Remove unnecessary copies of the pipeline 2015-07-05 15:01:15 -07:00
Jasper St. Pierre
aacc3d5628 shaped-texture: Repeat edge pixels instead of mirroring the image
While nothing will completely fix X11's artifacts, this tends to look a
bit better, *especially* with mask textures that have black at the
edges (which are most of them).

It's also faster for GPUs to manage.
2015-07-05 15:00:38 -07:00
Jasper St. Pierre
4c6866741d surface-actor-x11: Make sure to set a size when unredirected
When we're unredirected, we don't have a pixmap, and thus our allocation
becomes 0x0. So when events come in, they pass right through our actor,
going to the one underneath in the stack.

Fix this by having a fallback size on the shaped texture actor when
we're unredirected, causing it to always have a valid allocation.

This fixes clicking on stuff in sloppy / mouse mode focus.
2015-06-23 16:30:29 -07:00
Jasper St. Pierre
84baf4e181 shaped-texture: Clean up some internals
These are internal vfuncs, they don't need prechecks.
2015-06-23 16:18:38 -07:00
Rui Matos
7c5fe42835 meta-background: Add a function to refresh all background instances
We need to reload the FBOs under some circumstances, this adds a way
to easily do so.

https://bugzilla.gnome.org/show_bug.cgi?id=739178
2015-03-25 11:48:32 +01:00
Alban Browaeys
f858f66fe0 MetaBackgroundActor: glsl: do not mix int and float.
Implicit conversion from int to float is not supported by
GLSL ES.

Fixes:
(gnome-shell:8954): Cogl-WARNING **: Shader compilation failed:
1:2: P0004: High precision not supported, instead compiling high precision as medium precision
4:17: S0001: Type mismatch in arithmetic operation between 'int' and 'float'
when one trigger the overview mode on Mali 400 r1p1 GPU.

https://bugzilla.gnome.org/show_bug.cgi?id=745442
2015-03-03 22:09:35 +01:00
Jonas Ådahl
fffb863f37 wayland: Sync surface actor state when changing main monitor
In order to switch to the correct surface actor scale given the monitor
the surface is on, without relying on the client committing a new state
given some other side effect, sync the surface actor state when the main
monitor associated with the corresponding window changed.

https://bugzilla.gnome.org/show_bug.cgi?id=744933
2015-03-03 14:53:15 -05:00
Jonas Ådahl
bbcee174ce wayland: Make the surface actor set its own state
Since the surface actor knows more about how it draws itself, instead of
pushing texture state (buffer and scale), input region and opaque region
from MetaWaylandSurface after having transformed into what the surface
actor expects, make the surface actor set its own state given what state
the Wayland surface is in.

https://bugzilla.gnome.org/show_bug.cgi?id=744933
2015-03-03 14:53:15 -05:00
Chris Wilson
72f5a36522 compositor: Update composite overlay window before unredirecting
The current ordering updates the clip shape of the composite overlay
window after unredirecting the target window. This has the effect of
forcing X to clear the target window and sending an expose to the
application to repaint - causing an unsightly flash. If we update the
shape first, then unredirect, X restores the background of the root
window (sending no expose events as no one is interested) and the
background is typically NONE for the root window. Then the unredirect
paints the contents of the composite backing pixmap over top without
requiring a round trip and waiting for the client to repaint - thus no
flashing.

Fixes regression from

commit d6282716b2
Author: Jasper St. Pierre <jstpierre@mecheye.net>
Date:   Fri Dec 6 17:10:44 2013 -0500

    compositor: Simplify the unredirected window management code

Cc: Jasper St. Pierre <jstpierre@mecheye.net>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

https://bugzilla.gnome.org/show_bug.cgi?id=743858
2015-02-02 15:41:24 +01:00
Rui Matos
3f2d658f20 monitor-manager: Expose MetaMonitorManager to introspection
This just exposes the type and the singleton getter necessary to make
it available to introspection. We'll expose more functionality as it
becomes needed.

https://bugzilla.gnome.org/show_bug.cgi?id=743745
2015-01-30 13:13:49 -05:00
Jonas Ådahl
22c13b3144 plugins/Makefile.am: Don't fail when trying to remove nonexisting file
https://bugzilla.gnome.org/show_bug.cgi?id=743189
2015-01-19 09:37:54 -08:00
Owen W. Taylor
5e84c8f20b MetaWindowActor: don't overwrite send_frame_messages_timer
If the app finished multiple frames before we sent _NET_WM_FRAME_DRAWN,
we could add the send_frame_messages_timer multiple times. In the rare
case that the app immediately closed the window, the older timeout
could potentially then run on the freed actor.

https://bugzilla.gnome.org/show_bug.cgi?id=738686
2014-12-02 11:47:13 -05:00
Owen W. Taylor
9745f9f8ce Fix problems resulting in left-over queued frames
* Use -1 rather than 0 as a flag for pending queue entries; 0 is
  a valid frame_counter value from Cogl.
* Consistently handle the fact we can have more than one pending
  entry. It's app misbehavior to submit a new frame before
  _NET_WM_FRAME_DRAWN is received; but we accept such frame messages,
  so we can't just leak them.
* If we remove send_frame_message_timer, assign the current frame counter
  to pending entries.
* To try to avoid regressing on this, when sending _NET_WM_FRAME_TIMINGS
  messages, if we have stale messages, or messages with no frame drawn
  time, warn and remove them from the queue rather than just accumulating.
* Improve commenting.

https://bugzilla.gnome.org/show_bug.cgi?id=738686
2014-12-02 11:47:13 -05:00
Carlos Garnacho
e96eb0e82e compositor: Always recurse over surface children actors when picking
The parent pick() implementation in ClutterActor only recurses if the
vfunc is untouched, which means it's up to the MetaWaylandSurface
implementation to actually recurse, just the same as if an input mask
applied.

https://bugzilla.gnome.org/show_bug.cgi?id=738890
2014-11-24 14:44:11 +01:00
Florian Müllner
6e25c37da1 window-actor: Do not request unredirection when destroyed
WindowActors can outlive their corresponding window to animate unmap.
Unredirecting the actor does not make sense in that case, so make
sure to not request it.

https://bugzilla.gnome.org/show_bug.cgi?id=740133
2014-11-18 16:10:12 +01:00
Carlos Garnacho
700d367937 compositor: Ensure child actors are included in picking
If the actor surface has an input mask, custom picking is implemented
for the portions affected by the mask, although the child actors (most
usually subsurfaces) are left out.

https://bugzilla.gnome.org/show_bug.cgi?id=738890
2014-10-23 16:53:44 +02:00
Cosimo Cecchi
a37f632b1b background: use GFiles instead of filenames
We want to use GResources for system backgrounds, so move this to a
GFile.

https://bugzilla.gnome.org/show_bug.cgi?id=736936
2014-10-14 18:54:36 -07:00
Adel Gadllah
cd32e4a68a meta-surface-actor-x11: Fix unredirect heuristic
Damage coordinates are relative to the drawable not to the screen. So we
have to check whether x and y are 0 and not window_rect.x/y otherwise the
herustic will never trigger for windows on monitors whos x and y are not 0.

https://bugzilla.gnome.org/show_bug.cgi?id=738271
2014-10-12 00:35:47 +02:00
Adel Gadllah
a116509301 meta-surface-actor-x11: Detatch the pixmap in window_decorated_notify
The window can change its decoration without changing its size.

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

Found by Jasper St. Pierre <jstpierre@mecheye.net>
2014-10-08 23:11:47 +02:00
Owen W. Taylor
272e1fb296 MetaBackgroundActor: queue a redraw when the background changes
When the MetaBackground changes, queue the actor for redraw.
2014-10-08 15:03:02 -04:00
Jasper St. Pierre
8e85015f91 default: Adjust the default background
Getting a bit tired of green...
2014-10-07 20:42:26 -07:00
Carlos Garnacho
28e59c5a8f compositor: Add MetaDnDActor
This actor is a subclass of MetaFeedbackActor that additionally
implements the "drag failed" animation, snapping back to the drag
origin position in a surface.
2014-10-06 19:39:43 -07:00
Carlos Garnacho
b588baf9f5 compositor: Add MetaFeedbackActor
This actor is a non-reactive container that autoembeds itself into
the feedback window group in the compositor. The API is meant to
help on creating things attached to pointer/touchpoints, with an
X/Y attachment offset, and following the position of certain events.
2014-10-06 19:39:43 -07:00
Carlos Garnacho
9a825d9bee compositor: Add a "feedback" window group
Although not strictly a window group... This ClutterActor is
meant to stay always on top, and only show non-reactive actors
created by Mutter itself. Two possible usecases for this layer
are DnD surfaces, and touch spots.

We might also want to move cursors out of an overlay in MetaStage
into here at some point.
2014-10-06 19:39:43 -07:00
Owen W. Taylor
b735571688 MetaBackgroundImage: free the GdkPixbuf after creating a texture
The GdkPixbuf used to load a texture was never freed.
2014-09-29 21:32:48 -04:00
Owen W. Taylor
458953268b MetaBackground: fix getting stuck in a bad state after monitor changes
After the ::monitors-changed signal, set the dirty flag on each new
monitor information struct so the per-monitor resources will be
recreated.
2014-09-12 14:59:20 -04:00
Owen W. Taylor
e27bbdc769 Fix colors for horizontal background gradients
COGL_PIXEL_FORMAT_RGB_888 is packed 3-bytes per pixel.
2014-09-12 11:00:55 -04:00
Owen W. Taylor
09b46029fa Fix multi-monitor backgrounds
The texture area was meant to be in monitor-relative coordinates, but that
was not consistently followed throughout the code - fix.

https://bugzilla.gnome.org/show_bug.cgi?id=736568
2014-09-12 11:00:55 -04:00
Florian Müllner
8d53ae894b window-actor: Skip frame-sync when the corresponding window is gone
https://bugzilla.gnome.org/show_bug.cgi?id=735927
2014-09-11 16:50:23 +01:00
Florian Müllner
d50f8afa9e window-actor: Consider needs_destroy in is_destroyed()
According to the documentation, the method returns "whether the X window
that the actor was displaying has been destroyed" - that is very much
true when we delay the actual actor destruction for a destroy animation,
so update the method accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=735927
2014-09-11 16:50:23 +01:00
Florian Müllner
98fa343588 window-actor: Keep in compositor's window list until destroyed
When a window is destroyed, the corresponding actor may still be
kept around for the destroy effect. But as the actor is removed
from the compositor's stack list immediately, the compositor will
always stack it above "valid" window actors - this is not what we
want, so only update the compositor's list when the actor is
actually destroyed.

https://bugzilla.gnome.org/show_bug.cgi?id=735927
2014-09-11 16:50:23 +01:00
Florian Müllner
9be3e56b70 background: Fix monitor validation in get_texture()
Monitor indexes should be in the range [0, n], not [-1, 0] :-)
2014-09-06 18:22:56 +02:00
Jasper St. Pierre
7e0822c5b1 background-actor: Add missing paren 2014-09-05 13:51:21 -07:00
Jasper St. Pierre
3ea6424b8f background: Fix meta_background_new
This is used by the default plugin.
2014-09-03 19:55:15 -07:00
Jasper St. Pierre
883c4a7b0f background-actor: Add a simple paint volume
Not having a paint volume causes every single paint to turn into
full-stage redraw, since otherwise culling won't properly work.

Since we don't paint outside of our allocation, just use the simple
default implementation, but also return TRUE inside it.
2014-09-03 11:08:48 -07:00
Jasper St. Pierre
d4317ba1e4 background: Fix build
These warnings weren't properly working on Owen's machine, so they went
unchecked.
2014-09-03 11:03:17 -07:00
Owen W. Taylor
9d69b2a963 MetaBackground: add properties to set vignette settings
Make the vignette options properties so they can be animated;
modify the function-call API for meta_background_actor_set_vignette()
to correspond more closely to the 3 properties.

https://bugzilla.gnome.org/show_bug.cgi?id=735637
2014-09-03 13:43:40 -04:00
Owen W. Taylor
ef3b000050 MetaBackgroundActor: match total dimming if GLSL is not present
Without GLSL, we didn't apply the vignetting, which not only made the
background uniform in color, it made it much lighter. Adjust for this
and make the average brightness with the vignette effect the same
with or without GLSL.

https://bugzilla.gnome.org/show_bug.cgi?id=735637
2014-09-03 13:43:40 -04:00
Owen W. Taylor
a4a688ed83 Rewrite background code
The old requirement that multiple MetaBackgroundActor objects be
layered on top of each to produce blended backgrounds resulted in
extremely inefficient drawing since the entire framebuffer had
to be read and written multiple times.

 * Replace the MetaBackground ClutterContent with a plain GObject
   that serves to hold the background parameters and prerender
   textures to be used to draw the background. It handles
   colors, gradients, and blended images, but does not handle
   vignetting

 * Add vignetting to MetaBackgroundActor directly.

 * Add MetaBackgroundImage and MetaBackgroundImageCache to allow
   multiple MetaBackground objects to share the same images

By removing the usage of ClutterContent, the following optimizations
were easy to add:

 Blending is turned off when the actor is fully opaque
 Nearest-neighbour filtering is used when drawing 1:1

The GLSL vignette code is slightly improved to use a vertex shader
snippet for computing the texture coordinate => position in actor
mapping.

https://bugzilla.gnome.org/show_bug.cgi?id=735637
2014-09-03 13:43:40 -04:00
Owen W. Taylor
17dc5c57dd Use meta_actor_painting_untransformed() for MetaShapedTexture
The old check for using NEAREST by checking clutter_actor_is_in_clone_paint()
and meta_actor_is_untransformed (actor) doesn't work properly since
clutter_actor_is_in_clone_paint() does not look at ancestors of the
actor; it only applies to a direct clone of the actor. Using
meta_actor_painting_untransformed() allows us to check exactly what we
care about rather than using tricky approximations.

https://bugzilla.gnome.org/show_bug.cgi?id=735632
2014-09-03 13:43:40 -04:00
Owen W. Taylor
ef5f939db8 Factor out meta_actor_painting_untransformed()
The painting_untransformed() function in MetaWindowGroup is useful
elsewhere, in particular if we want to check whether we can avoid
bilinear filtering when painting a texture 1:1.

https://bugzilla.gnome.org/show_bug.cgi?id=735632
2014-09-03 13:43:40 -04:00
Jasper St. Pierre
2f9840a51c compositor: Conditionalize some more Wayland support 2014-08-27 12:56:39 -04:00
Jasper St. Pierre
09aefdba43 compositor: Conditionalize more Wayland support 2014-08-27 12:41:26 -04:00
Jasper St. Pierre
b091cbf361 shaped-texture: Don't set a small minimum size
The shaped-texture is effectively fixed size. It doesn't make sense to
have less allocation than requested.
2014-08-27 10:00:19 -04:00
Jasper St. Pierre
a6fcda69ac shaped-texture: Remove the use of MetaWindowActor internals
I want to make this class an independent helper.
2014-08-27 10:00:19 -04:00
Adel Gadllah
3a8bad1e6f meta-surface-actor: Fix is_argb32 for unredirected windows
meta_surface_actor_is_argb32 assumes that lack of stex means that a window is
ARGB32. When we unredirect a window we detach the texture so we end up without
a texture. Given that should_unredirect returns FALSE when a window is argb32,
we know that this window is indeed not ARGB32.

Returing TRUE in that case causes us to flip between redirected and
unredirected on every paint.

So fix that by returning FALSE in that case.
2014-08-26 18:59:02 +02:00
Jasper St. Pierre
6526118d9f shaped-texture: Fix a typo in a comment 2014-08-25 10:52:07 -04:00
Jasper St. Pierre
c15b3b4a09 shaped-texture: Fix the logic when the blended region is empty
When the blended region was empty, meaning we didn't have to paint
anything blended -- the case for an app update -- was drawing the
entire window blended, because of a think-o in the complex and
complicated logic.

Fix this so that we don't draw anything for the blended region when
empty.
2014-08-25 09:30:15 -04:00
Jasper St. Pierre
01a47c7d6d shaped-texture: If we have too many rectangles, don't paint the opaque
region first

If we're going to render the entire texture blended, then don't bother
painting the unblended stuff, since we're just going to draw on top
anyway.
2014-08-24 12:38:29 -04:00
Rico Tzschichholz
ecc254c659 surface-actor-x11: Fix "incompatible pointer type" error
Caused by e73c46ce03
2014-08-22 07:38:08 +02:00
Jasper St. Pierre
9cb1c95e49 surface-actor: Call process_damage even when the actor is invisible
Otherwise, surface-actor-x11 won't be marked as having received damage,
which is vital to updating the actual surface.
2014-08-21 18:30:56 -04:00
Jasper St. Pierre
e73c46ce03 surface-actor-x11: Use the existing check for "visibility"
Instead of doing our own thing here.
2014-08-21 18:30:35 -04:00
Jasper St. Pierre
952e9c52bc surface-actor-x11: Merge a simple function inline
This is a one-liner, only used in one place.
2014-08-21 18:30:17 -04:00
Jasper St. Pierre
dc0437a5b5 surface-actor-wayland: Pass in a CoglTexture, as well
This makes it so that MetaSurfaceActorWayland is effectively just a
wrapper actor around MetaShapedTexture with some extra scaling. I think
the MetaSurfaceActor subclassing was a bad idea -- we really should have
these abstractions in much higher levels in the stack than the
compositor.
2014-08-21 16:34:29 -04:00
Jasper St. Pierre
55331a0678 surface-actor-wayland: Don't store the buffer
We don't need to anymore -- we're purely texture based.
2014-08-21 16:24:30 -04:00
Jasper St. Pierre
f5580f61f9 wayland: Update the CoglTexture in the MetaWaylandSurface
It doesn't make sense to update it in the surface actor. It's also
theoretically wrong to update the buffer's texture on surface commit,
too, because it's buffer state, not surface state, but I don't think
there's any place we use a wl_buffer without a wl_surface.
2014-08-21 16:22:53 -04:00
Jasper St. Pierre
0e758a9e65 display: Establish a separate state variable for routing events
We've long used a switch statement on the grab operation to determine
where events should go. The issue with MetaGrabOp is that it's a mixture
of a few different things, including event routing, state management,
and the behavior to choose during operations.

This leads to poorly defined event routing and hard-to-follow logic,
since it's sometimes unclear what should point where, and our utility
methods for determining grab operations apart can be poorly named.

To fix this, establish the concept of a "event route", which describes
where events should be routed to.
2014-08-15 16:08:49 -04:00
Jasper St. Pierre
5f0fab2156 Conditionalize Wayland support again 2014-08-13 20:28:22 -04:00
Jasper St. Pierre
467465c99c backend: Create the stage in the backend, rather than the compositor
This allows creating the stage much earlier than it otherwise would have
been. Our initialization sequence has always been a bit haphazard, with
first the MetaBackend created, then the MetaDisplay, and inside of that,
the MetaScreen and MetaCompositor.

Refactor this out so that the MetaBackend creates the Clutter
stage. Besides the clarity of early initialization, we now have much
easier access to the stage, allowing us to use it for things such as
key focus and beyond.
2014-08-13 20:08:46 -04:00
Jasper St. Pierre
e935b52e51 display: Move composite version checks here 2014-08-13 19:32:39 -04:00
Jasper St. Pierre
e320b06aaa texture-tower: Fix error case in meta-texture-tower
If we for some reason have an error trying to allocate the framebuffer,
we'll still mark the tower as revalidated. Move the validation to the
end of the actual revalidation code to solve this.
2014-08-08 17:29:26 -04:00
Jasper St. Pierre
b284126d3b background: Don't bother attaching a paint node if the region is empty 2014-08-07 14:59:59 -04:00
Jasper St. Pierre
6858cb261f background-actor: Don't bother clipping to the content box
We already clip to the content box when we go to paint the content.
2014-08-07 14:58:18 -04:00
Jasper St. Pierre
2d6954186e background: Don't render with blending when we don't need to
If we have an opaque background image, then we shouldn't need to blend
against anything for it to work. Turn off blending in this case.
2014-08-07 14:01:14 -04:00
Jasper St. Pierre
d72bf0cd5d compositor: Don't use cogl_texture_new_with_data in the obvious cases
It's a deprecated API that can surprise us. Namely, when the internal
format passed is COGL_PIXEL_FORMAT_ANY, it will *always* allocate an
RGBA8888 pixel format texture, even if we only passed it a RGB format
or even an A8 format.

cogl_texture_2d_new_with_data is the newer, better API and doesn't have
these warts.
2014-08-07 14:01:14 -04:00
Jasper St. Pierre
584460deec background: Merge the code for creating the color texture into here
It's unused anywhere else.
2014-08-07 13:49:16 -04:00
Jasper St. Pierre
e3d5969282 background: Don't bother supporting alpha channels for gradients 2014-08-07 13:39:21 -04:00
Owen W. Taylor
249468bbea MetaTextureTower: actually mark revalidated levels as valid
We were never actually clearing the invalid area on the smaller levels
of the texture tower, so we recomputed those levels every time.

https://bugzilla.gnome.org/show_bug.cgi?id=734400
2014-08-07 15:56:28 +02:00
Rui Matos
7d54631ebf backends: Make MetaBackend available to introspection
This moves meta-backend.h under meta/ and, for now, just exposes to
introspection the methods that we actually need in gnome-shell.

https://bugzilla.gnome.org/show_bug.cgi?id=734301
2014-08-07 11:31:59 +02:00
Jasper St. Pierre
c2fe6a18ad shadow-factory: Comment fixes 2014-08-02 18:55:44 -04:00
Jasper St. Pierre
f9a77aec3f shadow-factory: Fix style 2014-07-31 17:49:13 +02:00
Jasper St. Pierre
bee6d2b240 shadow-factory: Untabify 2014-07-31 17:49:13 +02:00
Jasper St. Pierre
9a6a189e36 window-actor: Rebuild the shape and mask when the surface updates
Connecting to size-changed is wrong -- size-changed tells us when
we *told* the X server or resize the window. For X11, we're sort of
guaranteed that the surface will be updated at some point before the
next frame, but for Xwayland, we can't be sure that the new surface is
attached at this point.

This fixes weird artifacts when resizing apps like xclock.
2014-07-31 17:49:13 +02:00
Jasper St. Pierre
505eabb78c surface-actor: Remove unused APIs 2014-07-31 17:49:13 +02:00
Giovanni Campagna
b0ba325f0e MetaShapedTexture: fix critical warnings with fully obscured windows
If a window is fully obscured, it could have a negative paint volume
width/height. Normalize that to 0x0.
2014-07-31 16:21:32 +02:00
Jasper St. Pierre
6fbd21001b window-actor: Base the paint volume on our children, not our shape
This was wrong for subsurfaces that extend beyond the parent's shape,
since the paint volume would be wrong in this case. Instead of using the
shape region which can be out of date and wrong, just use the union of
our children's volumes, which is a lot easier to manage.
2014-07-30 17:15:00 +02:00
Jasper St. Pierre
626e4965b1 shaped-texture: Remove silly ClutterPaintVolume code with slightly less silly ClutterActorBox code 2014-07-30 17:09:23 +02:00
Jasper St. Pierre
6954d23444 window-actor: Don't connect to allocation-changed
This can cause allocation loops. Connect to size-changed to update the
shape instead.
2014-07-28 11:32:52 +02:00
Jasper St. Pierre
25f8eaf1ac shaped-texture: Clean up slightly 2014-07-28 11:23:36 +02:00
Cosimo Cecchi
cd84317346 compositor: add support for unminimize compositor effects
https://bugzilla.gnome.org/show_bug.cgi?id=733789
2014-07-26 17:26:40 +02:00
Carlos Garnacho
70aee2d95e display: cancel wayland client touches when the compositor is grabbed
When a compositor grab begins, clients will stop receiving events, so any
ongoing sequence at that time must be cancelled.

https://bugzilla.gnome.org/show_bug.cgi?id=733631
2014-07-24 18:07:30 +02:00
Adel Gadllah
37652ca2cf background: Do not assume GLSL is available
Some hardware does not support it causing crashes in cogl during paint.

https://bugzilla.gnome.org/show_bug.cgi?id=733623
2014-07-24 16:51:53 +02:00
Rui Matos
f55737ec06 compositor: Sync X drawing only once per frame
We only need to call XSync() once per frame to synchronize X with GL
drawing.

https://bugzilla.gnome.org/show_bug.cgi?id=728464
2014-07-23 13:59:18 -04:00
Adel Gadllah
6ee5a1437c x11: Move event filter to backend connection 2014-07-19 18:51:26 +02:00
Owen W. Taylor
182a267f69 Connect to ClutterStage::after-paint with connect_after()
Use connect_after() to accomodate code in GNOME Shell that,
when benchmarking drawing performance, connects to ::after-paint
and calls glFinish(). The timing information from that will be
more accurate if we hold off until that completes before we signal
apps to begin drawing the next frame. If there are no other
connections to ::after-paint, connect() vs. connect_after() doesn't
matter.

https://bugzilla.gnome.org/show_bug.cgi?id=732350
2014-07-16 13:38:15 -04:00
Jasper St. Pierre
b11405570a compositor: Don't bother selecting for events on the COW
We already select all the events we need on the stage window instead.
2014-07-15 17:18:37 -04:00
Jasper St. Pierre
463b50e746 screen: Fetch the COW window up-front
XGetCompositeOverlayWindow is a round trip to the X server. We shouldn't
be doing it on every MapWindow.
2014-07-10 14:18:02 -04:00
Jasper St. Pierre
1af9e92e91 Don't add in our old input event mask when we select input events
This causes a round-trip to the server, and just isn't necessary, since
we're always in charge of our event mask.
2014-07-10 13:30:05 -04:00
Carlos Garnacho
79e682bcd0 compositor: emit grab-op-begin/end signals on plugin grabs
This makes it possible to track there grabs triggered this way, in
addition to the ones handled by mutter.
2014-07-07 19:18:21 -04:00
Giovanni Campagna
8d08851f28 compositor: show the stage after we set the size
So that it is actually respected
2014-07-01 20:28:00 +02:00
Jasper St. Pierre
af135c0b0b monitor-manager: Rename output_id to winsys_id
The output_id is more of an opaque identifier for the monitor, based on
its underlying ID from the windowing system. Since we also use the term
"output_id" for the output's index, rename our use of the opaque cookie
"output_id" to "winsys_id".
2014-07-01 13:24:34 -04:00
Owen W. Taylor
bc510378b3 Switch to using ClutterStage::after-paint
The experimental API clutter_stage_set_paint_callback() is replaced
with an ::after-paint signal as of Clutter 1.19.5.
2014-06-27 14:36:32 -04:00
Owen W. Taylor
9c6e527d4b Add ::first-frame signal to MetaWindowActor
This signal is emitted the first time a frame of contents of the
window is completed by the application and has been drawn on the
screen. This is meant to be used for performance measurement of
application startup.

https://bugzilla.gnome.org/show_bug.cgi?id=732343
2014-06-27 10:37:42 -04:00
Nikita Churaev
d0cafab836 Change shadow radiuses to match new Adwaita more or less
Exact simmilarity is not possible yet due to different blurring algorithms.

https://bugzilla.gnome.org/show_bug.cgi?id=731866
2014-06-19 11:55:24 +02:00
Jasper St. Pierre
24d7c5ebe3 compositor: Simplify meta_window_actor_set_updates_frozen
Since we always call it with the same value, just push that
value into the implementation.
2014-06-17 13:10:42 -04:00
Jasper St. Pierre
188e4e1b92 window: Rename get_input_rect to get_buffer_rect
With get_input_region existing, get_input_rect is a misnomer. Really,
it's about the geometry of the output surface, and it's only used that
way in the compositor code.

Way back when in GNOME 3.2, get_input_rect was added when we added
invisible borders. get_outer_rect was always synonymous with server-side
geometry of the toplevel. get_outer_rect was used for both user-side
policy (the "frame rect") and to get the geometry of the window.

Invisible borders were meant to extend the input region of the frame
window silently. Since most users of get_outer_rect cared about the
frame rect, we kept that the same and added a new method, get_input_rect
to get the full rect of the framed window with all invisible borders for
input kept on.

As time went on and CSD and Wayland became a reality, the relationship
between the server-side geometry and the "frame rect" became more
complicated, as can be evidenced by the recent commits. Since clients
don't tend to be framed anymore, they set their own input region.

get_buffer_rect is also sort of a poor name, since X11 doesn't really
have buffers, but we don't really have many other alternatives.

This doesn't change any of the code, nor the meaning. It will always
refer to the rectangle where the toplevel should be placed.
2014-06-17 10:33:52 -04:00
Jasper St. Pierre
3c0fae74f1 window: Move get_toplevel_xwindow to window-x11 2014-06-16 18:29:38 -04:00
Florian Müllner
af3aae7295 meta-window-actor: Don't add shadows to popups if the toolkit already does
GTK+ will add its own shadows client-side, so we don't need to anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=731353
2014-06-10 13:40:33 +02:00
Florian Müllner
98e219da4b shadow-factory: Make sure to never use a negative spread
The smallest possible spread corresponds to an unblurred shadow, which
neither grows nor shrinks - thus the spread should be zero not negative
as returned by our current calculation.

https://bugzilla.gnome.org/show_bug.cgi?id=731353
2014-06-10 13:40:32 +02:00
Rico Tzschichholz
8734477d52 meta: Add generated meta-version.h
Avoid populating *_VERSION constants through cflags in pkg-config-file
which could be overridden by the project using it. Properly prefix the
defines with META_ to make gi-scanner happy.
2014-06-05 14:05:16 +02:00
Rico Tzschichholz
847a3bbee3 build: Fix some warnings and clean up a bit 2014-06-04 19:31:37 +02:00
Florian Müllner
b64548ee1f Pass button_rect when opening window menu from button
When opening the window menu without an associated control - e.g.
by right-clicking the titlebar or by keyboard - using coordinates
for the menu position is appropriate. However when the menu is
associated with a window button, the expected behavior in the
shell can be implemented much easier with the full button geometry:
the menu will point to the center of the button's bottom edge
rather than align to the left/right side of the titlebar as it
does now, and the clickable area where a release event does not
dismiss the menu will match the actual clickable area in mutter.

So add an additional show_window_menu_for_rect() function and
use it when opening the menu from a button.

https://bugzilla.gnome.org/show_bug.cgi?id=731058
2014-06-02 23:49:48 +02:00
Florian Müllner
d380d30ef4 Update (allow-none) annotations
The annotation has been deprecated in favor of (nullable) and/or
(optional).
2014-05-28 21:55:03 +02:00
Florian Müllner
31db32e826 Actually implement opening the app menu
The last commit added support for the "appmenu" button in decorations,
but didn't actually implement it. Add a new MetaWindowMenuType parameter
to the show_window_menu () functions and use it to ask the compositor
to display the app menu when the new button is activated.

https://bugzilla.gnome.org/show_bug.cgi?id=730752
2014-05-27 19:40:06 +02:00
Jasper St. Pierre
6513cbb470 Add back coordinates to the window menu
It looks weird to have Alt+Space pop up under the cursor instead
of the top-left corner of the window, and the Wayland request will
pass through the coordinates as well.

Add it to the compositor interface, and extend the
_GTK_SHOW_WINDOW_MENU ClientMessage to support it as well.
2014-05-22 10:50:57 -04:00
Jasper St. Pierre
8640982e68 Convert window menus to a compositor implementation 2014-05-17 15:16:23 -04:00
Adel Gadllah
fa29a1a99e Fix last commit
Actually do the changes from the review ... pushed old version of the
patch :/
2014-05-03 12:00:27 +02:00
Adel Gadllah
f9bffae9fd wayland: Scale native surfaces for hidpi
Scale surfaces based on output scale and the buffer scale set by them.
We pick the scale factor of the monitor there are mostly on.

We only handle native i.e non xwayland / legacy clients yet.

https://bugzilla.gnome.org/show_bug.cgi?id=728902
2014-05-03 10:11:55 +02:00
Jasper St. Pierre
25a16c3379 Remove trailing whitespace 2014-05-02 09:34:48 -04:00
Jasper St. Pierre
aed6d4fbb7 default: Remove the maximize effect
It looks awful, and doesn't work with Wayland at all for some
reason, which means that maximize seems to "hang" for half a
second. Just trash it.
2014-04-28 15:20:49 -04:00
Jasper St. Pierre
270c7abd3c default: Remove the unmaximize implementation
It does nothing.
2014-04-28 15:20:48 -04:00
Jasper St. Pierre
e2bd15541b default: Remove unused internal state tracking 2014-04-28 15:20:48 -04:00
Jasper St. Pierre
63f1a10e33 compositor: Don't select for weird events on the COW/stage
Talking it over with Owen, we weren't sure why this was here.

At one point, we were creating a foreign stage window, so potentially
Clutter didn't select for its own events, but now we're using a standard
stage window, so this seems weird.

Why we did it on the COW, nobody knows. Maybe copy/paste bugginess?
2014-04-24 16:26:21 -04:00
Jasper St. Pierre
925075ddaf compositor: Don't select for stage events on the UI X11 connection 2014-04-24 12:12:53 -04:00
Jasper St. Pierre
41de208f31 compositor: Also ungrab the VCP when beginning a modal
XXX: This should not be needed. We need to figure out why
there's a grab on the UI connection.
2014-04-24 11:26:12 -04:00
Jasper St. Pierre
e9eb3c32a9 compositor: Move event spoofing code to MetaBackendX11
This is now where we handle device events.
2014-04-23 14:23:13 -04:00
Jasper St. Pierre
61b714c666 compositor: Remove "exclusive is exclusive" codepath
We now handle input events in the backend.
2014-04-23 14:23:13 -04:00
Jasper St. Pierre
e9263d25b9 compositor: Take modal grabs through the backend as well 2014-04-23 14:23:12 -04:00
Jasper St. Pierre
d590626017 compositor: Select for input on the output window the right display 2014-04-23 14:23:12 -04:00
Jasper St. Pierre
91784d87b6 Move the painting of the cursor on the stage out of the cursor renderer
This logic is now well-contained the stage. This is the start of us
moving to backend-specific cursor renderers.
2014-04-22 16:56:02 -04:00
Jasper St. Pierre
2769683521 Rename MetaWaylandStage to MetaStage and put in compositor/ 2014-04-22 16:56:02 -04:00
Jasper St. Pierre
168ede9374 compositor: Create the MetaWaylandStage here 2014-04-22 16:56:01 -04:00
Jasper St. Pierre
bb4896f1af plugin: Don't pass events to Clutter
We do this ourselves in the backend
2014-04-22 12:44:33 -04:00
Bastien Nocera
d53e04f4c8 Name all timeouts and idles
Better names can be used once we make more use of them.

https://bugzilla.gnome.org/show_bug.cgi?id=727979
2014-04-10 18:59:46 +02:00
Florian Müllner
7ac66faa72 tower: Fix erroneous return value
The function's return value is void, not gboolean.
2014-04-09 12:10:24 -07:00
Robert Bragg
d0b870d3a9 tower: make sure not to blend when updating tower
Each level in the tower is initialized by binding the texture for that
level to an offscreen framebuffer and rendering the previous level as a
textured rectangle. The problem was that we were blending the previous
level with undefined data so argb32 windows with transparencies would
result in artefacts. This makes sure to disable blending when drawing
the textured rectangle.
2014-04-09 12:10:17 -07:00
Jasper St. Pierre
99ad5c00a7 texture-tower: Remove CPU codepath for mipmap generation
The CPU codepath for mipmapping is unusably slow, and we expect modern
graphics cards with modern TFP/FBO support.
2014-04-09 12:10:00 -07:00
Jasper St. Pierre
b9e9595e8b errors: Kill off meta_error_trap_push_with_return
It isn't special; it's just an alias for meta_error_trap_push.
2014-04-07 10:37:03 -04:00
Jasper St. Pierre
8373c90cd8 background: Remove load_still_frame
Nothing uses it, and it's incompatible with XWayland anyway.
2014-04-02 12:35:24 -04:00
Jasper St. Pierre
6296fefea6 window-actor: Clean up has_shadow
This has some particularly picky #if 0'd code. Since the history for
it isn't illuminating in the slightest, I'm just going to kill it.
2014-04-02 11:40:04 -04:00
Jasper St. Pierre
ccced506ed Rename monitor => meta-monitor-manager 2014-03-31 22:05:24 -04:00
Jasper St. Pierre
82e02e39d3 window-actor: Fix the input shape region for decorated X11 windows
The code here before was completely wrong. Not only did it mix up
coordinate spaces of "client rect" vs. "frame rect", but it used
meta_frame_get_frame_bounds, which is specifically for the *visible*
bounds of a window!

In the case that we don't have a bounding or input shape region at
all on the client window, the input shape that we should apply is
the surface's natural shape. So, set the region to NULL to get the
natural rect picking semantics.
2014-03-30 20:16:58 -04:00
Matthias Clasen
f4f529385a Fix the build with -Werror=maybe-uninitialized
gcc can't really know that the condition won't change between
the first if and the second, so help it out by initializing
the variable up top.
2014-03-27 14:58:20 -04:00
Adel Gadllah
6eeaf09ab7 compositor: Don't call process_damage if the window is gone
We might get a damage event for an already unmanaged window calling
process_damage is pointless and causes a crash so simply skip that case.

https://bugzilla.gnome.org/show_bug.cgi?id=727115
2014-03-27 14:06:27 +01:00
Jasper St. Pierre
cd905a34fb compositor: Kill off MetaCompScreen
Compositors haven't been able to manage more than one screen for
quite a while. Merge MetaCompScreen into MetaCompositor, and update
the API to match.

We still keep MetaScreen in the public compositor API for compatibility
purposes.
2014-03-26 12:04:48 -04:00
Jasper St. Pierre
47aa583625 display: Kill off grab_screen
Just like active_screen, the screen can always be inferred
from the MetaDisplay, so there's no point in keeping it around.
2014-03-26 12:04:48 -04:00
Jasper St. Pierre
d7519f4ebc Remove any possibility for zaphod mode
We previously separated out MetaDisplay and MetaScreen. mutter
would only manage one screen, but we still kept a list of screens
for simplicity.

With Wayland support, we no longer care about the ability to
manage more than one screen at a time. Remove this by killing
the list of screens, in favor of having just one MetaScreen
in MetaDisplay.

We also kill off active_screen at the same time, since it's
not necessary anymore.

A future cleanup should merge MetaDisplay and MetaScreen. To avoid
breaking API, we should probably keep MetaScreen around as a dummy
type.
2014-03-26 12:04:48 -04:00
Jasper St. Pierre
cc0488f1e2 surface-actor: Implement is_argb32 generically for both X11 and Wayland
cogl_texture_get_components can be used on both X11 and Wayland
backends. Technically, the detection is different: we actually
check the actual RENDER format in the old code, while Cogl simply
assumes that any pixmap with a depth >= 32 is ARGB32. Since Cogl
already seems to be working with its internal checks, it makes
more sense to  use Cogl's check rather than keeping our own.
2014-03-25 17:04:39 -04:00
Jasper St. Pierre
e30ed6892c surface-actor: Prevent a dumb crash
is_argb32 can be called at any time, including times when we don't
have a texture. In that case, just assume we're ARGB32. The value
really shouldn't be important though.
2014-03-25 17:04:37 -04:00
Jasper St. Pierre
272676b896 surface-actor-wayland: Make sure to clean up on dispose
We need to remove our destroy handler if the surface is destroyed
before the buffer is, which is the case when we have no destroy
effect.
2014-03-25 12:00:38 -04:00
Jasper St. Pierre
1cfaf45389 surface-actor-wayland: Fix meta_surface_actor_wayland_is_argb32
This prevents us from clipping shadows under windows for all
apps, and loads of other fun optimizations.
2014-03-20 18:03:38 -04:00
Jasper St. Pierre
57359da9b4 wayland: Kill the buffer destroy error
Previously, a sequence like this would crash a client:

  => surface.attach(buffer)
  => buffer.destroy()

The correct behavior is to wait until we release the buffer before
destroying it.

  => surface.attach(buffer)
  => surface.attach(buffer2)
  <= buffer.release()
  => buffer.destroy()

The protocol upstream says that "the surface contents are undefined"
in a case like this. Personally, I think that this is broken behavior
and no client should ever do it, so I explicitly killed any client
that tried to do this.

But unfortunately, as we're all well aware, XWayland does this.
Rather than wait for XWayland to be fixed, let's just allow this.

Technically, since we always copy SHM buffers into GL textures, we
could release the buffer as soon as the Cogl texture is made.

Since we do this copy, the semantics we apply are that the texture is
"frozen" in time until another newer buffer is attached. For simple
clients that simply abort on exit and don't wait for the buffer event
anyhow, this has the added bonus that we'll get nice destroy animations.
2014-03-20 13:53:05 -04:00
Jasper St. Pierre
e67abdd3ff compositor: Kill unused variable 2014-03-20 13:18:55 -04:00
Jasper St. Pierre
ca4777f778 compositor: Make code a bit more understandable 2014-03-20 13:18:47 -04:00
Rui Matos
76dc0ca681 wayland: Exempt CLICKING grab ops when syncing wayland input focus
If we have a CLICKING grab op we still need to send events to xwayland
so that we get them back for gtk+ to process thus we can't steer
wayland input focus away from it.

https://bugzilla.gnome.org/show_bug.cgi?id=726123
2014-03-20 17:08:53 +01:00
Rui Matos
1b29113150 wayland: Set/unset wayland focus on mutter grab/ungrab operations
This ensures that we send the proper leave and enter events to wayland
clients.

Particularly, this solves a bug in SSD xwayland windows where clicking
and dragging on the title bar to move the window only works on the odd
turn (unless the pointer moves away from the title bar between
tries). This happens because xwayland gets a button press but doesn't
see the release so when it gets the next button press it discards it
because its pointer button tracking logic says that the button is
already pressed. Sending the proper wayland pointer leave event fixes
it since wayland clients must forget about button state at that point.

https://bugzilla.gnome.org/show_bug.cgi?id=726123
2014-03-20 17:08:53 +01:00
Jasper St. Pierre
044c06bff3 Don't include wayland/ by default either 2014-03-18 22:04:36 -04:00
Jasper St. Pierre
a3ccc4fd1c Remove x11/ directory from default include path 2014-03-18 22:04:36 -04:00
Jasper St. Pierre
b087fce062 window-actor: Also always assume the plugin manager exists
Addendum to the above...
2014-03-18 18:31:07 -04:00
Jasper St. Pierre
420f322910 compositor: Assume the plugin manager always exists 2014-03-18 18:25:33 -04:00
Jasper St. Pierre
4bf6e0ae8c compositor: Kill off an unused cursor variable 2014-03-18 18:25:33 -04:00
Jasper St. Pierre
97872e70a5 compositor: Fix variable name style in meta_shape_cow_for_window
This has bugged me forever...
2014-03-18 18:25:33 -04:00
Jasper St. Pierre
be57308663 compositor: Clean up
Remove a bunch of weird checks, random logs, unused variables
and other cruft that nobody cares about today.
2014-03-18 18:25:32 -04:00
Jasper St. Pierre
33f1bd96f5 compositor: Kill off modal_plugin
We only ever have one plugin, so don't bother recording which plugin
is modal, only whether we are modal or not.
2014-03-18 18:25:32 -04:00
Jasper St. Pierre
9ba49358e5 compositor: Remove meta_check_end_modal
"This is used when reloading plugins"

Yeah, no.
2014-03-18 18:25:32 -04:00
Jasper St. Pierre
4fdbb466e1 meta-plugin: Remove some unused features
And don't use properties for no reason.
2014-03-18 18:25:31 -04:00
Jasper St. Pierre
0f85986340 Add a META_MAXIMIZE_BOTH
Which has the value of META_MAXIMIZE_VERTICAL |
META_MAXIMIZE_HORIZONTAL.

This is an obvious code cleanup.
2014-03-15 09:49:56 -04:00
Jasper St. Pierre
dd8d8e436d wayland: Remove special code for modal grabs
Since we never pass any Clutter events to Wayland, it's not needed.
2014-03-10 15:10:44 -04:00
Florian Müllner
94f39a493f window-actor: Guard against %NULL frame mask
Creating a new cogl texture may fail, in which case the intent to
free it will crash. While something is clearly wrong (insanely
large window, oom, ...), crashing the WM is harsh and we should
try to avoid it if at all possible, so carry on.

https://bugzilla.gnome.org/show_bug.cgi?id=722266
2014-02-28 20:11:58 +01:00
Adel Gadllah
d41fba6558 meta-shaped-texture: Check if the parent has mapped clones as well
When the  WindowActor has mapped clones we should ignore
the unobscured region as well, so we need to walk up and check it
as well.

https://bugzilla.gnome.org/show_bug.cgi?id=725180
2014-02-28 18:27:37 +01:00
Jasper St. Pierre
770b58b367 wayland: Move "public" Wayland API to another header file 2014-02-28 10:24:06 -05:00
Rui Matos
674bcef6da Handle mouse-button-modifier being disabled
In case 'mouse-button-modifier' is disabled the mask is 0 which means
we would always grab.
2014-02-28 14:55:14 +01:00
Giovanni Campagna
b9a5d710b7 compositor: always redirect passive button grabs to clutter
All WM events (passive button grabs and passive keyboard grabs)
are handled through clutter now, so we must make sure we spoof
them even if they happen on frames (because that's where we
grab on)
2014-02-27 14:37:48 +01:00
Giovanni Campagna
65dd54a4db compositor: don't spoof events when running as a wayland compositor
Weirdly, clutter stopped segfaulting when we call clutter_x11 methods
and the backend is not right, but this is correct anyway, and
probably fixes some BadDrawable errors in mutter-wayland on x11,
caused by mixing windows of the outer X and windows of Xwayland.
2014-02-27 14:28:46 +01:00
Giovanni Campagna
b00fa70d91 display: move more event handling to clutter
Mouse event handling was duplicated, resulting in weird interactions
if clutter was allowed to see certain events (for example under
wayland, where it gets all events). Because now clutter sees all
X events, even when running as an x11 compositor, we can handle
everything using the clutter variants.
At the same time, rewrite a little the passive button grab code,
to make it clear what is being matched on what and why.
2014-02-27 03:13:33 +01:00
Giovanni Campagna
360d423faa MetaSurfaceActor: add a generic hook to retrieve the MetaWindow
This way we can find the window for a ClutterEvent even when
running as an x11 compositor.
2014-02-27 03:13:33 +01:00
Giovanni Campagna
394b44a2c2 compositor: fix mouse interactions on frames
meta_ui_window_is_widget() returns FALSE for frame windows, so we
must filter those explicitly (by letting the event go to gtk
and from there to MetaFrames). Also, for proper gtk widgets
(window menus) we want to let gtk see all events, including
keyboard, otherwise we break keynav in the window menu.
This means that having a window menu open disables keybindings
(because the event doesn't run through clutter)
2014-02-27 03:13:32 +01:00
Giovanni Campagna
ed6821a819 keybindings: fix per window keybindings
We must spoof events to clutter even if they are associated
with a MetaWindow, because keyboard events are always associated
with one (the focus window), and we must process keybindings
for window togheter with the global ones if they include Super,
because we're not going to see them again.
2014-02-27 03:13:32 +01:00
Jasper St. Pierre
eb75306f8a Revert "window-actor: Complete the removal of update_shape"
This reverts commit 640102c03b.
2014-02-26 20:52:44 -05:00
Jasper St. Pierre
98c4b82907 Revert "window: Update the shape, input, and opaque regions immediately"
This reverts commit c0d791cd6e.
2014-02-26 20:45:38 -05:00
Jasper St. Pierre
640102c03b window-actor: Complete the removal of update_shape
I accidentally stashed the rest of the stuff and forgot to
commit it... oops.
2014-02-26 20:04:19 -05:00
Jasper St. Pierre
c0d791cd6e window: Update the shape, input, and opaque regions immediately
... and individually. It turns out that updating the opaque region
was causing the shape region to be updated, which was causing a new
shape mask to be generated and uploaded to the GPU. Considering
GTK+ regenerates the opaque region on pretty much any focus change,
this is not good.
2014-02-26 20:03:16 -05:00
Jasper St. Pierre
41d5e69de5 window-actor: Kill off another use of MetaFrameBorders 2014-02-26 20:02:13 -05:00
Jasper St. Pierre
2dc7371944 window-actor: Don't pass around client_area
To solve a performance regression, the three update_*_region
calls are going to be split up, so just call get_client_area_rect
in the methods itself.
2014-02-26 20:02:11 -05:00
Jasper St. Pierre
ec2c3e1438 window: Add meta_window_get_client_area_rect 2014-02-26 19:54:41 -05:00
Adel Gadllah
d85845426c window-actor: Fix culling
At some point meta_window_actor_cull_out stopped calling
meta_cullable_cull_out_children which caused the unobscured region
to never be set for the stex.

https://bugzilla.gnome.org/show_bug.cgi?id=725216
2014-02-26 15:01:07 +01:00
Giovanni Campagna
9f5087e97d Fix input and bounding shapes
For decorated windows, we don't want to apply any input
shape, because the frame is always rectangular and eats
all the input.
The real check is in meta-window-actor, where we consider
if we need to apply the bounding shape and the input shape
(or the intersection of the two) to the surface-actor,
but as an optimization we avoid querying the server in
meta-window.
Additionally, for undecorated windows, the "has input shape"
check is wrong if the window has a bounding shape but not an
input shape.
2014-02-25 01:27:32 +01:00
Giovanni Campagna
45624f2edf MetaWindowActor: survive having no MetaSurfaceActor
We need a MetaWaylandSurface to build a MetaSurfaceActor, but
we don't have one until we get the set_window_xid() call from
XWayland. On the other hand, plugins expect to see the window
actor right from when the window is created, so we need this
empty state.

Based on a patch by Jasper St. Pierre.
2014-02-25 01:22:56 +01:00
Giovanni Campagna
153f843ea6 MetaSurfaceActor: move freeze accounting to MetaWindowActor
Turns out we only ever need to freeze/thaw whole windows, not
surfaces or subsurfaces.
This will allow removing the surface actor without losing
the count.
2014-02-25 01:20:22 +01:00
Jasper St. Pierre
f0cd9b0687 wayland-surface: Rework construction / destruction yet again
This time, to make way for MetaSurfaceActorEmpty. This also fixes
destroy effects as a side effect. It still has issues if we try
to re-assign an actor that's already toplevel (e.g. somebody
re-popping up a menu that's already being destroyed), but this
will be fixed soon.

The idea here is that MetaWindowActor will do the unparenting of
the surface actor when it itself is destroyed. To prevent bad issues
with picking, we only make the surface actor reactive when it's
toplevel.
2014-02-24 14:46:19 -05:00
Jasper St. Pierre
9b24ae2033 Revert "compositor: Delay meta_compositor_add_window until the first show"
This reverts commit 4efe4483fb.
2014-02-24 14:46:18 -05:00
Jasper St. Pierre
04b5232960 compositor: The stage is always focused when we're a Wayland compositor
gnome-shell has some complex tracking to set the X input focus
correctly, assuming various things about how the stage is set up in X11.
For instance, it assumes that all actors that get key focus are
gnome-shell Chrome actors that will get events through the stage, so
when one of them is focused, it will try to set the focus back to the
stage.

In Wayland, windows are considered chrome actors that will get key
events through the stage, so this only has the result of unfocusing any
windows that have just received key focus.

We should probably move this input focus moving to mutter instead of
gnome-shell so we can better use mutter's internal state and heuristics.
2014-02-23 12:34:53 -05:00
Jasper St. Pierre
f860df4b2d Revert "compositor: fix focusing the stage window"
This reverts commit 876f81db12.

This doesn't quite work properly, and is overcomplicated.
2014-02-23 12:34:52 -05:00
Adel Gadllah
14841475b5 meta-window-actor: Fix paint_volume
We cannot intersect the the complete volume with the unobscured bounds
because it does not include the shadows. So just intersect it with the
windows's shape bounds and union it with the shadow bounds.

This also matches what the comment in the code says:
"We could compute an full clip region as we do for the window texture,
but the shadow is relatively cheap to draw, and a little more complex to clip,
so we just catch the case where the shadow is completely obscured
and doesn't need to be drawn at all."
2014-02-21 20:39:25 +01:00
Jasper St. Pierre
020cfa7283 surface-actor-x11: Recreate damage when the toplevel X window changes 2014-02-20 14:50:48 -05:00
Jasper St. Pierre
83aca0b53d window-actor: Split into two subclasses of MetaSurfaceActor
The rendering logic before was somewhat complex. We had three independent
cases to take into account when doing rendering:

  * X11 compositor. In this case, we're a traditional X11 compositor,
    not a Wayland compositor. We use XCompositeNameWindowPixmap to get
    the backing pixmap for the window, and deal with the COMPOSITE
    extension messiness.

    In this case, meta_is_wayland_compositor() is FALSE.

  * Wayland clients. In this case, we're a Wayland compositor managing
    Wayland surfaces. The rendering for this is fairly straightforward,
    as Cogl handles most of the complexity with EGL and SHM buffers...
    Wayland clients give us the input and opaque regions through
    wl_surface.

    In this case, meta_is_wayland_compositor() is TRUE and
    priv->window->client_type == META_WINDOW_CLIENT_TYPE_WAYLAND.

  * XWayland clients. In this case, we're a Wayland compositor, like
    above, and XWayland hands us Wayland surfaces. XWayland handles
    the COMPOSITE extension messiness for us, and hands us a buffer
    like any other Wayland client. We have to fetch the input and
    opaque regions from the X11 window ourselves.

    In this case, meta_is_wayland_compositor() is TRUE and
    priv->window->client_type == META_WINDOW_CLIENT_TYPE_X11.

We now split the rendering logic into two subclasses, which are:

  * MetaSurfaceActorX11, which handles the X11 compositor case, in that
    it uses XCompositeNameWindowPixmap to get the backing pixmap, and
    deal with all the COMPOSITE extension messiness.

  * MetaSurfaceActorWayland, which handles the Wayland compositor case
    for both native Wayland clients and XWayland clients. XWayland handles
    COMPOSITE for us, and handles pushing a surface over through the
    xf86-video-wayland DDX.

Frame sync is still in MetaWindowActor, as it needs to work for both the
X11 compositor and XWayland client cases. When Wayland's video display
protocol lands, this will need to be significantly overhauled, as it would
have to work for any wl_surface, including subsurfaces, so we would need
surface-level discretion.

https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-02-20 14:44:31 -05:00
Jasper St. Pierre
0b055fae2e window-actor: Kill off needs_pixmap
It's mostly equivalent to the case where we've already detached
the pixmap, *except* for the x11_size_changed case. We can simply
detach the pixmap at the time the window changes size, though.

https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-02-20 11:51:52 -05:00
Jasper St. Pierre
bc79259398 window-actor: Don't queue a redraw when queueing a new pixmap
We guarantee ourselves that a valid pixmap will appear any time
that the window is painted. The window actor will be scheduled
for a repaint if it's added / removed from the scene graph, like
during construction, if the size changes, or if we receive damage,
which are the existing use cases where this function is called.

So, I can't see any reason that we queue a redraw in here.

With the split into surface actors, we don't have an easy place
we can use to queue a redraw, and since it's unnecessary, we can
just drop it on the floor.

https://bugzilla.gnome.org/show_bug.cgi?id=720631
2014-02-20 11:35:01 -05:00
Stefano Facchini
4de3f7ca29 Make tile preview a compositor plugin effect
https://bugzilla.gnome.org/show_bug.cgi?id=665758
2014-02-19 21:55:35 +01:00
Jasper St. Pierre
c964ef4e01 window-actor: Fix build
I'm bad.
2014-02-19 01:11:42 -05:00
Jasper St. Pierre
0dccc440b6 window-actor: Kill off a nonsensical edge case
We can never have a window actor that represents either the X root
window or the stage window, so it doesn't make sense to bail out
early in case we do.

I'd imagine that this came from a much earlier version of the code
where the compositor was much separate and had its own MapNotify
handling.
2014-02-18 23:36:46 -05:00
Jasper St. Pierre
c251eb8ec0 window-group: Don't special-case the unredirected window
Since the unredirected window MetaWindowActor is stacked on top, it
will naturally get culled out of the process, so we can remove the
special casing here. Unfortunately, with the way that the code is
currently structured, it's too difficult to actually prevent setting
the clip / visible regions if the window is redirected, so just let
those be set for unredirected windows for now.
2014-02-18 21:29:50 -05:00
Jasper St. Pierre
1e6b3faa83 Fix the input region not working properly
The input region was set on the shaped texture, but the shaped texture
was never picked properly, as it was never set to be reactive. Move the
pick implementation and reactivity to the MetaSurfaceActor, and update
the code everywhere else to expect a MetaSurfaceActor.
2014-02-18 21:29:23 -05:00
Jasper St. Pierre
ed18580118 default: Improve the destroy effect as well 2014-02-17 19:27:33 -05:00
Jasper St. Pierre
c485637a61 default: Don't use anchor points
It doesn't work now that we set the pivot point. This breaks the
maximize effect, but it fixes the destroy effect. The maximize effect
looks bad anyway, so it's not too important to me.
2014-02-17 17:57:45 -05:00
Jasper St. Pierre
2f4563132a default: Use a consistent rand() for monitor backgrounds
g_random_int() is seeded with /dev/urandom, so it's not consistent.
2014-02-17 14:02:13 -05:00
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