1
0
Fork 0
Commit graph

957 commits

Author SHA1 Message Date
Armin Krezović
dacc041d0c Switch meta_error_trap functions to MetaX11Display
They are X11 specific functions, used for X11 code. They have been
improved per jadahl's suggestion to use gdk_x11_lookup_xdisplay and
gdk_x11_display_error_trap_* functions, instead of current code.

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Armin Krezović
18779109de Start populating MetaX11Display
- Moved xdisplay, name and various atoms from MetaDisplay
- Moved xroot, screen_name, default_depth and default_xvisual
  from MetaScreen

- Moved some X11 specific functions from screen.c and display.c
  to meta-x11-display.c

https://bugzilla.gnome.org/show_bug.cgi?id=759538
2018-07-06 19:47:16 +02:00
Daniel van Vugt
04e411c2c0 compositor: Remove dead code: META_DISABLE_MIPMAPS
Seems to have been unused for quite some time.
2018-07-04 11:08:49 +08:00
Daniel van Vugt
c9c3283540 shaped-texture: Disable mipmapping during animation
This avoids overwhelming the GPU with trying to update mipmaps at a high
rate. Because doing so could easily cause a reduction in the compositor
frame rate and thus actually reduce visual quality.

In the case of a window that is constantly animating in the overview,
this reduces mutter's render time by around 20%-30%.
2018-05-18 16:45:26 +08:00
Florian Müllner
7655e09d00 build: Introspect some more types
While MetaStage, MetaWindowGroup and MetaDBusDisplayConfigSkeleton don't
appear explicitly in the public API, their gtypes are still exposed via
meta_get_stage_for_screen(), meta_get_*window_group_for_screen() and
MetaMonitorManager's parent type. Newer versions of gjs will warn about
undefined properties if it encounters a gtype without introspection
information, so expose those types to shut up the warnings.

https://bugzilla.gnome.org/show_bug.cgi?id=781471
2018-05-07 21:44:47 +02:00
Florian Müllner
be069fb8ae window-group: Remove undefined function declaration
Ever since the function has been made public, its name has been
meta_actor_is_untransformed() ...

https://bugzilla.gnome.org/show_bug.cgi?id=781471
2018-05-07 21:44:47 +02:00
Carlos Garnacho
70036429bd wayland: Abstract access to the actor corresponding to a wl_surface
The actor itself will be shuffled around, abstract all external
access to it behind a function to make that easier later on.
2018-04-23 12:24:46 +02:00
Olivier Fourdan
85bbd82ae8 window-actor: add new signal "effects-completed"
When using plugins, the effects will affect the MetaWindowActor size
and position.

Add a new signal "effects-completed" wired to the corresponding
MetaWindowActor which is emitted when all effects are completed so that
derived objects can be notified when all effects are completed and use
the actual size and position.

Closes: https://gitlab.gnome.org/GNOME/mutter/issues/104
2018-04-09 10:19:26 +02:00
Jonas Ådahl
44624736c5 wayland: Push actor state instead of itself pulling
Make the Wayland objects push the state relevant to their role to the
MetaSurfaceActor instead of MetaSurfaceActorWayland pulling the state
from the associated surface.

This makes the relationship between the actor and the objects that
constructs it more clear; the actor is a drawable that the protocol
objects control, not the other way around.

This will make it easier to "detach" a surface actor from a surface,
which is necessary when unmapping a window while the underlying surface
is yet to be destroyed and potentially reused.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/5
https://bugzilla.gnome.org/show_bug.cgi?id=791938
2018-02-23 18:57:47 +08:00
Jonas Ådahl
0162cdf8ef surface-actor/wayland: Minor style fixes
https://gitlab.gnome.org/GNOME/mutter/merge_requests/5
https://bugzilla.gnome.org/show_bug.cgi?id=791938
2018-02-23 18:57:45 +08:00
Ting-Wei Lan
6cc48d8cbb build: Fix non-wayland builds
meta_dnd_wayland_handle_end_modal is not available on non-wayland build.

https://bugzilla.gnome.org/show_bug.cgi?id=791916
2017-12-24 17:55:14 +08:00
Marco Trevisan (Treviño)
1a1db9ef8d window-actor: rename destroy function in queue_destroy
Since this might delay the destruction after animation
has succeeded, it's just better to rename this accordingly.

https://bugzilla.gnome.org/show_bug.cgi?id=791006
2017-11-30 22:53:26 -05:00
Marco Trevisan (Treviño)
b1587f0716 compositor: reset top_window_actor and remove it from windows when destroyed
When the top window actor is destroyed, we need to make sure that
all its references are removed or it could be picked again in next
windows sync, causing crashes.
Since the window might or might not be destroyed when removed (depending
weather animations are in progress over it or not), it's just safer
to wait it to be destroyed before cleaning up any of its reference.

https://bugzilla.gnome.org/show_bug.cgi?id=791006
2017-11-30 22:53:26 -05:00
Carlos Garnacho
6c18bae83c compositor: Fix build
Unused variable definition. The fixup didn't make it to the previous
commit.
2017-11-17 16:58:54 +01:00
Carlos Garnacho
d0531966eb compositor: End MetaDnd grab on plugin grab end
We must emit ::dnd-leave to pair the ::dnd-enter that shall be
emitted whenever the plugin grab begins, otherwise we leave
listeners unable to clean up if the plugin begins and ends a
grab while there is an ongoing DnD operation.

https://bugzilla.gnome.org/show_bug.cgi?id=784545
2017-11-17 14:43:50 +01:00
Carlos Garnacho
c2fad2dc7c compositor: Keep reference to the screen on the MetaBackground
This is not a leak per se, but it seems too easy to make valgrind
SIGSEGV due to MetaBackground disconnecting signals from an already
destroyed MetaScreen when trying to SIGTERM gnome-shell. Keeping a
reference fixes this.

https://bugzilla.gnome.org/show_bug.cgi?id=789984
2017-11-06 20:51:58 +01:00
Marco Trevisan (Treviño)
91e3a0b3a9 MetaWindowActor: assert that we have plugin manager on simple effect
It looks that there are some extensions that run a Mainloop on startup,
causing to dispatch a clutter paint before the compositor is even available.
In such scenario a MetaWindow could try to start a simple effect
using a compositor plugin which is not there yet.

Then in order to catch these bugs we can now assert that the expected
conditions are valid, so that gnome-shell will provide a dumpstack to
debug the real offending JS code.

https://bugzilla.gnome.org/show_bug.cgi?id=789223
2017-10-24 04:42:54 -05:00
Marco Trevisan (Treviño)
0ebea2be9c Revert "MetaWindowActor: don't start any effect when no compositor is available"
This reverts commit 35fcf4a4ae.
2017-10-20 03:25:31 -05:00
Marco Trevisan (Treviño)
6f54bab0a8 Revert "MetaPluginManager: don't try to deference a NULL pointer when processing events"
This reverts commit 74565380aa.
2017-10-20 03:23:28 -05:00
Marco Trevisan (Treviño)
35fcf4a4ae MetaWindowActor: don't start any effect when no compositor is available
There are cases when no compositor is available (yet) but a MetaWindow tries
to start a simple effect using a compositor plugin which is not available.
In that case we should just ignore any request and protect ourselves from
crashes.

https://bugzilla.gnome.org/show_bug.cgi?id=789223
2017-10-20 16:10:18 +08:00
Marco Trevisan (Treviño)
74565380aa MetaPluginManager: don't try to deference a NULL pointer when processing events
This function might be called by components with invalid plugin manager
(as it might happen to MetaWindow when the compositor isn't initialized
properly), so we need to protect ourselves from crashes.

https://bugzilla.gnome.org/show_bug.cgi?id=789223
2017-10-20 16:10:18 +08:00
Rui Matos
3caefd8fda compositor: Avoid a crash if the top window actor is finalized
Since we're not holding a reference, the top window actor might be
finalized when we paint resulting in a use after free crash.

https://bugzilla.gnome.org/show_bug.cgi?id=788493
2017-10-19 18:37:34 +02:00
Jonas Ådahl
2e99963087 compositor: Ignore offscreen windows when unredirecting
When determining whether we should unredirect a window or not, ignore
offscreen windows, and just check the top most visible window.

Previously this was not an issue, but since 'stack-tracker: Keep
override redirect windows on top' we started sorting the UI frames
window, which is an offscreen override redirect window, on top, causing
the unredirect checking code to always check whether to unredirect the
UI frames window. This effectively disabled the compositor bypass
functionality.

https://bugzilla.gnome.org/show_bug.cgi?id=788493
2017-10-17 14:50:18 +08:00
Jonas Ådahl
c1fe1c5d6b window-actor: Use monitor API to get frame message refresh rate
Use the MetaMonitor API instead of accessing outputs directly to get
the refresh rate used when genaritng the frame message.

https://bugzilla.gnome.org/show_bug.cgi?id=785381
2017-10-05 16:18:43 -04:00
Jonas Ådahl
9817a6aa47 Make MetaOutput a GObject
Turn MetaOutput into a GObject and move it to a separate file. This
changes the storage format, resulting in changing the API for accessing
MetaOutputs from using an array, to using a GList.

https://bugzilla.gnome.org/show_bug.cgi?id=785381
2017-10-05 16:18:43 -04:00
Alessandro Bono
068791f6c1 meta-background-actor: Add gradient effect
Add a gradient effect that goes from the top to the bottom. The
height and the initial dark tone of the gradient are customizable.

https://bugzilla.gnome.org/show_bug.cgi?id=786618
2017-09-07 16:59:56 +02:00
Alessandro Bono
cbc4563b30 meta-background-actor: Rename brightness to vignette_brightness
The brightness is about the vignette. Add a 'vignette_' prefix in order
to give more context. Keep the property name as it is, doing so we don't
break any plugin (e.g., gnome-shell).

https://bugzilla.gnome.org/show_bug.cgi?id=786618
2017-09-07 16:59:56 +02:00
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