1
0
Fork 0
Commit graph

980 commits

Author SHA1 Message Date
Alessandro Bono
f381d7c3bf meta-background-actor: Rename shader snippets
Add the word 'vignette' in order to give some context on what the
snippets do. This will be useful later when we land other snippets
for the gradient effect.

https://bugzilla.gnome.org/show_bug.cgi?id=786618
2017-09-07 16:59:56 +02:00
Alessandro Bono
7ba44e7945 meta-background-actor: Style fix
https://bugzilla.gnome.org/show_bug.cgi?id=786618
2017-09-05 01:39:30 +02:00
Alessandro Bono
168479862d meta-background-actor: Unset flags when they are not valid anymore
Currently, the flags that describe what is changed are never unsetted.
Unset each flag just after using them.

https://bugzilla.gnome.org/show_bug.cgi?id=783512
2017-08-21 22:18:28 +02:00
Olivier Fourdan
ce20c964a6 compositor: add vmethod to override inhibit shortcut dialog
A MetaPlugin implementation of the MetaInhibitShortcutsDialog can be
used in place of the default inhibit shortcut.

https://bugzilla.gnome.org/show_bug.cgi?id=783342
2017-08-02 11:58:55 +02:00
Silvère Latchurié
8153c5b544 compositor: Handle EXIF orientation for backgrounds
Apply the embedded EXIF orientation when the background is loaded.

https://bugzilla.gnome.org/show_bug.cgi?id=783125
2017-06-21 20:23:09 +02:00
Benoit Gschwind
e1950ed76f texture-tower: Fix usage of G_*_DECLS
https://bugzilla.gnome.org/show_bug.cgi?id=783505
2017-06-14 11:15:04 +02:00
Carlos Garnacho
27b949d6ba compositor: Remove MetaSurfaceActorWayland::painting signal
It's now unused.

https://bugzilla.gnome.org/show_bug.cgi?id=782344
2017-05-22 17:27:11 +02:00
Carlos Garnacho
68a9675d42 compositor: Expose MetaPlugin vmethod to create a MetaCloseDialog
So the actual close dialog can be overridden by MetaPlugin implementations.

https://bugzilla.gnome.org/show_bug.cgi?id=711619
2017-05-15 15:09:15 +02:00
Chris Vine
2f30098ab5 build: Fix non-wayland builds
Add the necessary preprocessor guards that were missed in commits
65e9c89ed9 and 6d64123849 ...

https://bugzilla.gnome.org/show_bug.cgi?id=780533
2017-05-11 13:45:44 +02:00
Jonas Ådahl
8163ca6821 Add support for scaled logical monitor framebuffers
This commit adds support for rendering onto enlarged per logical
monitor framebuffers, using the scaled clutter stage views, for HiDPI
enabled logical monitors.

This works by scaling the mode of the monitors in a logical monitors by
the scale, no longer relying on scaling the window actors and window
geometry for making windows have the correct size on HiDPI monitors.

It is disabled by default, as in automatically created configurations
will still use the old mode. This is partly because Xwayland clients
will not yet work good enough to make it feasible.

To enable, add the 'scale-monitor-framebuffer' keyword to the
org.gnome.mutter.experimental-features gsettings array.

It is still possible to specify the mode via the new D-Bus API, which
has been adapted.

The adaptations to the D-Bus API means the caller need to be aware of
how to position logical monitors on the stage grid. This depends on the
'layout-mode' property that is used (see the DisplayConfig D-Bus
documentation).

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:48 +08:00
Jonas Ådahl
1c54c7a1bb window: Replace monitor scale getter with geometry scale
All places that get the 'main monitor scale' of a window really just
wants the window geometry scale, so call it that.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-04-07 22:30:48 +08:00
Hyungwon Hwang
65e9c89ed9 dnd: Implement DnD handling code in Wayland
No XDnD events which notify DnD status change comes in Wayland. To emulate XDnD
behavior, MetaDnd checks whether there is a grab or not when the modal window
starts showing. When there is a grab, it processes the raw events from
compositor, and emits DnD signals for plugin.

https://bugzilla.gnome.org/show_bug.cgi?id=765003
2017-03-07 08:28:36 +08:00
Hyungwon Hwang
5fafaf92df dnd: Implement MetaDnd
Implement MetaDnd for emitting DnD signals to plugins such as gnome-shell. The
xdnd handling code comes from gnome-shell, and it is hidden behind MetaDnd now.

https://bugzilla.gnome.org/show_bug.cgi?id=765003
2017-03-07 08:28:36 +08:00
Piotr Drąg
ead62f1901 Use Unicode in translatable strings
See https://developer.gnome.org/hig/stable/typography.html

https://bugzilla.gnome.org/show_bug.cgi?id=772218
2017-02-16 02:44:16 +01:00
Juraj Fiala
91c6a144da Update shadows to match Adwaita better
This should make Mutter shadows almost indifferentiable to the ones made
by Adwaita. Based on an initial patch from Maxim <dead.555@bk.ru>.

https://bugzilla.gnome.org/show_bug.cgi?id=744667
2017-02-15 23:54:07 +01:00
Florian Müllner
cb86745245 window-actor: Special-case COMBO window's shadow class
We currently don't have any shadow class for combo box popups,
which means the default shadow of normal windows is used. That's
clearly odd given that the two are very different, and isn't
consistent with GTK+-3's client-side shadows for popups. While
we could add a dedicated shadow class, the designers are fine
with reusing the existing shadow for dropdown-menus, so let's
do that.

https://bugzilla.gnome.org/show_bug.cgi?id=744667
2017-02-15 23:54:07 +01:00
Carlos Garnacho
2cd78bffd9 compositor: Avoid thaw on inconsistent effect_completed calls
If the meta_window_actor_effect_completed() triggers inconsistent
accounting, there's also high chances that the thaw call will be
unexpected at this time too, which will lead to a g_error().

This makes mutter more lenient to effect_completed() calls of the
right type (i.e. those triggering freeze/thaw) being performed more
times than necessary in the upper parts. A warning will be issued,
but the process won't abort.

https://bugzilla.gnome.org/show_bug.cgi?id=777691
2017-01-26 12:31:47 +01:00
Jonas Ådahl
4e812410cc monitor-manager: Move logical monitor into its own file
https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:53 +08:00
Jonas Ådahl
842ff5d6aa Rename MetaMonitorInfo MetaLogicalMonitor
In preparation for further refactorizations, rename the MetaMonitorInfo
struct to MetaLogicalMonitor. Eventually, part of MetaLogicalMonitor
will be split into a MetaMonitor type.

https://bugzilla.gnome.org/show_bug.cgi?id=777732
2017-01-25 16:28:51 +08:00
Rui Matos
1d280d8fa1 window: Inform the compositor when a window effectively changes size
In order for the compositor plugin to be able to animate window size
changes properly we need to let it know of the starting and final
window sizes.

For X clients this can be done synchronously and thus with a single
call into the compositor plugin since it's us (the window manager)
who's in charge of the final window size.

Wayland clients though, have the final say over their window size
since it's determined from the client allocated buffer.

This patch moves the meta_compositor_size_change_window() calls before
move_resize_internal() which lets the compositor plugin know the old
window size and freezes the MetaWindowActor.

Then we get rid of the META_MOVE_RESIZE_DONT_SYNC_COMPOSITOR flag
since it's not needed anymore as the window actor is frozen and that
means we can use meta_compositor_sync_window_geometry() as the point
where we inform the compositor plugin of the final window size.

https://bugzilla.gnome.org/show_bug.cgi?id=770345
2016-11-23 18:37:35 +01:00
Rui Matos
9c03e78505 MetaPlugin: add a size_changed vfunc
This will be used to let plugins know when a previous size change
actually becomes effective. This is needed to handle wayland client
resizing properly since, unlike X, it's async.

https://bugzilla.gnome.org/show_bug.cgi?id=770345
2016-11-23 18:37:31 +01:00
Florian Müllner
0aa6d9782c build: Fix cogl include paths
cogl-egl-defines.h is now referenced from a public header, so we need
to include its location whenever the header is used (directly or via
cogl.h).
2016-11-23 18:03:59 +01:00
Jonas Ådahl
5774fcdd80 MetaShapedTexture: Default to y-inverted being true
Normally textures in OpenGL are inverted on the Y axis, and we only
apply our rotation transform when it is not. To make the common case
work as normal, default to assuming textures are Y inverted.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 09:36:51 +08:00
Jonas Ådahl
7c31fb2450 MetaShapedTexture: Add support for setting a custom CoglSnippet
To support special types of buffer types, add support for setting a
CoglSnippet on the shaped texture which will then be added to the
pipeline.

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
11783ffdd0 MetaSurfaceActorWayland: Remove API never used externally anymore
https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Jonas Ådahl
41c96921d6 wayland: Add support for EGL_WAYLAND_Y_INVERTED_WL
Add support for inverted Y Wayland buffers. OpenGL textures are by
default inverted, so adding support for EGL_WAYLAND_Y_INVERTED_WL
effectively means adding support for non-inverted, which makes the
MetaShapedTexture apply a transformation when drawing only when querying
EGL_WAYLAND_Y_INVERTED_WL resulted in the response "EGL_FALSE".

https://bugzilla.gnome.org/show_bug.cgi?id=773629
2016-11-18 00:00:10 +08:00
Rui Matos
236417be38 compositor: End a wayland popup grab when starting a compositor grab
Wayland popup grabs, unlike other grab types, can be safely cancelled
so there's no reason to deny compositor grab requests if a wayland
popup is on.

In particular, this allows entering the overview via a keybinding or
locking the screen while a wayland popup has a grab which is something
that's been advertised as a wayland improvement over X.

https://bugzilla.gnome.org/show_bug.cgi?id=771235
2016-11-02 14:07:14 +01:00
Florian Müllner
9e5491439e window-actor: Make sync_visibility() public
When we mess with a window actor's visibility from the shell side
(yes, I know :-( ), we should at least restore the proper visibility
when we're done with it ...

https://bugzilla.gnome.org/show_bug.cgi?id=771536
2016-09-18 11:01:15 +02:00
Jonas Ådahl
2e7f11305c MetaWindowActor: Sync thawed state when surface actor is set
Not having a surface actor would cause the window actor state to be
considered frozen, thus causing various state (such as geometry, shape
etc) synchronization to be delayed until thawed. If the window actor
was "thawed" due to having a surface set, not all state would be
properly synchronized, causing the thawed window actor to be displayed
incorrectly.

This patch fixes this by putting state synchronization after thawing in
a common function, calling it both from frozen count decreasing and
surface setting.

This fixes for example misplaced menus in Steam.

https://bugzilla.gnome.org/show_bug.cgi?id=770991
2016-09-09 10:00:24 +08:00
Jonas Ådahl
28a898a22f Use signals instead of onscreen framebuffer frame callbacks
CoglFrameInfo is a frame info container associated with a single
onscreen framebuffer. The clutter stage will eventually support drawing
a stage frame with multiple onscreen framebuffers, thus needs its own
frame info container.

This patch introduces a new stage signal 'presented' and a accompaning
ClutterFrameInfo and adapts the stage windows and past onscreen frame
callbacks users to use the signal and new info container.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
749237a28e MetaWindowGroup: Only compensate for transforms when in clone paint
We were compensating for a clone paint viewport offset even when we
were not in clone paniting mode. This would break painting if we offset
the viewport for some other reason for example as in the future stage
view painting.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
7f0e6b9b4b compositor: Don't access use the onscreen framebuffer directly
Instead of assuming there is a single onscreen framebuffer, use the
helper functions for setting the frame callback and getting the frame
counter.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
a465e4c5b8 compositor: Initiate cogl context field on creation
There will only ever be one context; just get it from clutter instead
of waiting for we interact with a framebuffer.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
085df1170e plugins/default: Make the background a vignette
Make the default plugin background a vignette in order to see that it
properly draws using the correct scale.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Jonas Ådahl
dd1eaeb262 Use correct cogl object types
Use the correct pointer types for cogl objects. This avoids warnings
when including the cogl headers doesn't result in all the cogl types
being typedefs to void.

https://bugzilla.gnome.org/show_bug.cgi?id=768976
2016-07-20 14:23:48 +08:00
Rui Matos
cc6efeb14f MetaSurfaceActorX11: invalidate the stex on video memory purged errors
MetaShapedTexture uses FBOs when mipmapping so we need to cause them
to be recreated.

https://bugzilla.gnome.org/show_bug.cgi?id=739178
2016-06-27 20:23:50 +02:00
Rui Matos
53993ba4d2 MetaBackground: invalidate contents on video memory purged errors
We use FBOs so we need to cause them to be recreated.

https://bugzilla.gnome.org/show_bug.cgi?id=739178
2016-06-27 20:23:50 +02:00
Rui Matos
7f6bcea331 compositor: Handle GL video memory purged errors
Emit a signal so that interested parties can recreate their FBOs and
queue a full scene graph redraw to ensure we don't end up showing
graphical artifacts.

This relies on the GL driver supporting the
NV_robustness_video_memory_purge extension and cogl creating a
suitable GL context. For now we only make use of it with the X backend
since the only driver with which this is useful is NVIDIA.

https://bugzilla.gnome.org/show_bug.cgi?id=739178
2016-06-27 20:23:50 +02:00
Florian Müllner
53a9411255 surface-actor: Keep track of ignored damage
We ignore all damage while a surface is frozen and queue a full
update instead once it's thawed. While not super efficient, this
isn't overly bad for the intended case of catching up with any
updates that happened during a compositor effect. However when
extended frame sync is used, surfaces are also frozen while the
client is drawing a frame, in which case the current behavior is
pretty damaging (pun intended), as we end up redrawing the entire
window each frame. To address this, keep track of the actual damage
we ignore and apply it when the surface is thawed.

https://bugzilla.gnome.org/show_bug.cgi?id=767798
2016-06-17 21:39:06 +02:00
Jonas Ådahl
19f7e310d9 MetaSurfaceActorWayland: Use weak pointer instead of destroy hook
MetaWaylandSurface is a GObject now, so lets utilize that.

https://bugzilla.gnome.org/show_bug.cgi?id=763431
2016-05-01 21:11:27 +08:00
Jonas Ådahl
26815d68f6 MetaSurfaceActorWayland: Only NULL check surface on class vfuncs
The only time the surface pointer (priv->surface) may be NULL is when
the surface is unmanaged but still painting, possibly due to a unmap
animation or the like, so only guard handle this situation in the entry
points that may come from the stage painting.

https://bugzilla.gnome.org/show_bug.cgi?id=763431
2016-05-01 21:11:27 +08:00
Jonas Ådahl
bca041b68e MetaWindow: Make buffer_rect and rect share coordinate space
Before this commit, on Wayland, the buffer rect would have the size of
the attached Wayland buffer, no matter the scale. The scale would then
be applied ad-hoc by callers when a sane rectangle was needed. This
commit changes buffer_rect to rather represent the surface rect (i.e.
what is drawn on the stage, including client side shadow). The users of
buffer_rect will no longer need to scale the buffer_rect themself to
get a usable rectangle.

https://bugzilla.gnome.org/show_bug.cgi?id=763431
2016-05-01 21:11:27 +08:00
Rui Matos
1fa540bcb7 Fix the merged build
https://bugzilla.gnome.org/show_bug.cgi?id=760439
2016-04-27 20:37:47 +02:00
Florian Müllner
8842bdfb11 Do not skip CoglError parameters
While CoglError is a define to GError, it doesn't follow the convention
of ignoring errors when NULL is passed, but rather treats the error as
fatal :-(
That's clearly unwanted for a compositor, so make sure to always pass
an error parameter where a runtime error is possible (i.e. any CoglError
that is not a malformed blend string).

https://bugzilla.gnome.org/show_bug.cgi?id=765058
2016-04-15 17:22:24 +02:00
Florian Müllner
bdc72dd9d7 Do not try to unref NULL CoglObjects
https://bugzilla.gnome.org/show_bug.cgi?id=765058
2016-04-15 17:21:22 +02:00
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