Commit Graph

3042 Commits

Author SHA1 Message Date
Jasper St. Pierre
e72af50420 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-04 10:39:49 -05:00
Lionel Landwerlin
ef4417b717 window: don't ignore resize button release event for move/resize actions
https://bugzilla.gnome.org/show_bug.cgi?id=710251
2013-11-04 13:52:06 +00:00
Rico Tzschichholz
cf943627e2 build: Make sure built-sources are introspected as needed 2013-10-31 00:09:15 +01:00
Rico Tzschichholz
96543cb009 build: Do not ship generated source-files in tarball 2013-10-30 23:42:12 +01:00
Jasper St. Pierre
b82784ee46 display: Don't focus the no-focus-window when sending WM_TAKE_FOCUS to a globally active window
Clients like on-screen keyboards try not to take focus when the user clicks
on their window by setting the Input hint to false. However, due to GTK+ and
GDK bugs, the public API for setting the Input hint to false don't remove
WM_TAKE_FOCUS from WM_PROTOCOLS, unintentionally putting them into Globally
Active mode.

These clients also expect that since they don't want to take focus, they want
the focus to remain on the existing window. In this case, for clients like
on-screen keyboards, it's so they can send synthesized keyboard events to the
focused window.

https://bugzilla.gnome.org/show_bug.cgi?id=710296
2013-10-29 16:26:00 -04:00
Rico Tzschichholz
ecc1830296 meta-cursor-tracker: Add missing include of Xcursor.h 2013-10-29 11:39:02 +01:00
Asad Mehmood
e171a31ac5 monitor: expose min-backlight-step
Expose min-backlight-step so that gnome-settings-daemon can
support backlights with less than 10 steps without mutter
normalizing the brightness back to its original value

https://bugzilla.gnome.org/show_bug.cgi?id=710380
2013-10-21 23:22:41 +02:00
Bastien Nocera
a9a10aaa20 MonitorConfig: Use new UPower API
The "changed" signal was removed. Use "notify" instead
to track just the lid-is-closed state.
2013-10-21 14:00:48 +02:00
A. Walton
656d079ffc screen: Name the guard window
So that extensons can recognize it, for the case where they
want to watch the window list.

https://bugzilla.gnome.org/show_bug.cgi?id=710346
2013-10-16 22:39:21 -04:00
Jasper St. Pierre
89d01d2c17 core: Remove old unused methods 2013-10-16 01:29:56 -04:00
Jasper St. Pierre
ec284bc56a display: Fix whitespace / code style with autoraise stuff 2013-10-16 00:34:22 -04:00
Jasper St. Pierre
db2e00d41c keybindings: Remove unused function 2013-10-15 23:38:48 -04:00
Jasper St. Pierre
0a616c9fcb keybindings: Remove unused parameter from process_event 2013-10-15 23:38:47 -04:00
Jasper St. Pierre
fed3cd9e82 keybindings: Drop an unnecessary check 2013-10-15 23:38:47 -04:00
Jasper St. Pierre
d0d8a3d4ea window: Remove timestamp argument from change_workspace_by_index
It's unused, since we aren't activating the workspace.

https://bugzilla.gnome.org/show_bug.cgi?id=709776
2013-10-15 15:45:21 -04:00
Jasper St. Pierre
bdf5f88349 display: Deduplicate cursor loading code
Rather than do the cursor -> name translation ourselves in two different
places, use the facilities in libXcursor to do it for us. Put the shared
piece of code in meta-cursor-tracker, and use it for both server-side and
client-side cursor loading.
2013-10-15 15:39:58 -04:00
Giovanni Campagna
809dbe16d6 monitor-config: prevent assert that at least one output is connected
Apparently some connector technologies don't distinguish between
on and off, and there might be valid use cases for running without
any connected monitor.
In that case, just avoid any configuration at all.

https://bugzilla.gnome.org/show_bug.cgi?id=709009
2013-10-15 21:26:36 +02:00
Lionel Landwerlin
0e3aab8691 display: don't interrupt grab move/resize without modifiers
The part of code dealing with move/resize grab in display.c is only
responsible of this behavior when triggered with a modifier. So it
shouldn't stop the move/resize behavior triggered from a mouse event
without modifier on the title bar or sides of the window.

https://bugzilla.gnome.org/show_bug.cgi?id=704759
2013-10-13 01:58:56 +01:00
Lionel Landwerlin
55840c626c window: don't process unrelated release events
When processing button events related to moving/resizing the window,
only the first button should be considered.

https://bugzilla.gnome.org/show_bug.cgi?id=704759
2013-10-13 01:55:58 +01:00
Hans Petter Jansson
8af0e10aa4 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 02:38:52 +02:00
Jasper St. Pierre
71f574bc52 prefs: Fix introspection issues 2013-10-09 17:32:05 -04:00
Jasper St. Pierre
2518d6138f stack: Never try to focus a DOCK window 2013-10-09 17:32:05 -04:00
Adel Gadllah
36be084655 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:24:16 +02:00
Giovanni Campagna
85c2bc29e6 MetaIdleMonitor: protect the monitor instance while calling destroy notify
The destroy notify for a DBus watch holds a reference to the IdleMonitor,
but the IdleMonitorWatch object doesn't (it knows all watches will
be destroyed before the monitor is, so it doesn't need one). This
means that the DBus watch reference can be the only one keeping
the IdleMonitor alive (expecially true for device idle monitors,
which are only used by g-s-d/cursor), and that means that calling
the destroy notify freezes the monitor (and the next X calls
access garbage).

https://bugzilla.gnome.org/show_bug.cgi?id=708420
2013-09-26 18:55:44 +02:00
Giovanni Campagna
4eeeb1557a constraints: don't apply fullscreen workarounds for CSD windows
If you maximize a CSD window on a monitor without struts, it ends
up taking the whole monitor size, but it doesn't mean that the
application wants to fullscreen.

https://bugzilla.gnome.org/show_bug.cgi?id=708718
2013-09-26 10:35:05 +02:00
Owen W. Taylor
7b84590c71 MetaWindowActor: fix updates with multiple size changes in one frame
We must set 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)

Fix done together with Giovanni Campagna <gcampagn@redhat.com>
2013-09-25 13:13:19 -04:00
Giovanni Campagna
423bd70238 MonitorConfig: fix hole filling in the laptop lid automatic configuration
Need two passes, because the order we traverse the array is
alphabetical on connector name, not left to right, so we might
see a monitor on the right before we get the offset from disabling
the primary monitor.

https://bugzilla.gnome.org/show_bug.cgi?id=707473
2013-09-16 22:38:55 +02:00
Giovanni Campagna
2fc9e1af58 MetaIdleMonitor: fire immediately watches that are already expired
The XSync semantics mandate that alarms already expired will not
fire until the counter is reset and the alarm triggered again, so
clients traditionally called get_idle_time() first to see if they
should install the alarm.
This is inherently racy, as by the time the call is handled by
mutter and the reply received the idle time could be different.
Instead, if we see that the watch would have fired in the past,
fire it immediately.

This is a behavior change, but it's a compatible one, as all legacy
clients are calling get_idle_time() first, and it was perfectly
possible for the idle time counter to trigger the alarm right
after the get_idle_time() call.

https://bugzilla.gnome.org/show_bug.cgi?id=707302
2013-09-16 22:38:55 +02:00
Pavel Vasin
eba27a7e05 MonitorConfig: fix memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=708070
2013-09-14 17:06:15 +02:00
Pavel Vasin
4009267c2b shaped-texture: Fix memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=708070
2013-09-14 17:06:15 +02:00
Pavel Vasin
8a370c0094 window: Fix memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=708070
2013-09-14 17:06:15 +02:00
Pavel Vasin
abe0701ce7 workspace: Add missing chain-up for finalize()
https://bugzilla.gnome.org/show_bug.cgi?id=708070
2013-09-14 17:06:15 +02:00
Giovanni Campagna
08161078f4 Fixup previous commit
Had a wrong cursor name.
2013-09-12 10:32:58 +02:00
Giovanni Campagna
9def55914c display: add support for more cursor types
These cursors are used by gnome-shell, supporting them allows
to reduce GDK usage in the shell.

Also, make meta_screen_set_cursor() public.

https://bugzilla.gnome.org/show_bug.cgi?id=707919
2013-09-12 10:16:29 +02:00
Colin Guthrie
4883b96e0d MonitorXrandr: Mask a BadValue error on VirtualBox.
https://bugzilla.gnome.org/show_bug.cgi?id=707563
2013-09-11 23:29:15 +02:00
Giovanni Campagna
ca6a1aac2b 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:25:22 +02:00
Giovanni Campagna
cacdaa0067 Rename META_POWER_SAVE_UNKNOWN to UNSUPPORTED
It conveys more clearly what this value means.

https://bugzilla.gnome.org/show_bug.cgi?id=707649
2013-09-09 15:29:46 +02:00
Giovanni Campagna
016e2aec8e Monitor: don't shortcut set_power_save if the value is the same as the old one
We don't get notifications from X11 when the mode is reset, so
our cached value can get stale. To work around that, always forward
requests to the backend (and let it deal with ignoring the change
if wanted)

https://bugzilla.gnome.org/show_bug.cgi?id=707649
2013-09-09 15:29:46 +02:00
Adel Gadllah
f96dc97c4f 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 19:53:22 +02:00
Giovanni Campagna
40163c737c MetaCursorTracker: don't ask X to set the cursor visibility to the same value
Apparently, that's a Match error.
Yay for well designed APIs...
2013-09-04 18:02:06 +02:00
Giovanni Campagna
6327b8d15a MetaCursorTracker: add methods for setting the cursor visibility
clutter_stage_show_cursor()/hide_cursor() only works in the X11
backend (where someone else is in charge of showing the cursor),
and even then, it has confusing effects when running nested wayland,
so an abstraction layer is needed.

https://bugzilla.gnome.org/show_bug.cgi?id=707474
2013-09-04 17:20:53 +02:00
Giovanni Campagna
3053cc0de4 MetaCursorTracker: extend with query pointer abilities
We need an abstraction in gnome-shell for XQueryPointer, and
MetaCursorTracker seems a good place for it.

https://bugzilla.gnome.org/show_bug.cgi?id=707474
2013-09-04 17:20:53 +02:00
Giovanni Campagna
0b89e34439 MonitorConfig: remove holes generated by disabling the laptop lid
No, holes in the framebuffer are not a good a thing: windows can
get lost there, and the user can get very confused.
Instead, compact the monitors that where previously after.

https://bugzilla.gnome.org/show_bug.cgi?id=707473
2013-09-04 17:20:53 +02:00
Neil Roberts
c5bf60eab4 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
2013-09-04 14:23:51 +01:00
Jasper St. Pierre
bdbb852163 Make sure to always call va_end 2013-09-03 16:09:25 -04:00
Jasper St. Pierre
4a11f126cd compositor: Remove some uninitialized variables 2013-09-03 16:09:25 -04:00
Jasper St. Pierre
03f736607b theme-parser: Remove a duplicate paste
How did this sneak in there?
2013-09-03 16:09:24 -04:00
Jasper St. Pierre
5aa3a288dc display: Add some missing breaks
If we somehow get an event with a wrong device ID, we should not
be comparing bad event IDs.
2013-09-03 16:08:55 -04:00
Ray Strode
ddf566a3c4 compositor: initial has_window to FALSE in sync_actor_stacking
Spotted by Jasper, discussed on IRC.
2013-09-03 16:03:17 -04:00
Giovanni Campagna
9678a412e2 MonitorXrandr: check the event timestamps before reconfiguring
If, checking the event timestamps, we see that a new configuration
was explicitly requested by an another XRandR client, don't proceed to
apply the intended configuration again, even if looking at the
EDIDs it appears that the outputs changed.
This works around some buggy Xorg drivers (qxl, vbox) that generate
a new serial number everytime the user resizes the host window.

https://bugzilla.gnome.org/show_bug.cgi?id=706735
2013-09-02 16:14:15 +02:00
Giovanni Campagna
46f4ea7ed7 MonitorManager: make sure to pass the right sizes to vararg functions
A gulong is not enough to get 64 bits in all arches, so we must
cast it, or we can corrupt the stack.

This was downstream bug bugzilla.redhat.com/show_bug.cgi?id=1002055

https://bugzilla.gnome.org/show_bug.cgi?id=707267
2013-09-02 15:42:59 +02:00
Cosimo Cecchi
e3b1c2dea0 idle-monitor: fix event propagation to devices
device_id_max is set to the device_id in ensure_device_monitor(), but we
will loop only to (device_id_max - 1) when propagating the sync XEvent
down, missing the device correspondng to device_id_max.

https://bugzilla.gnome.org/show_bug.cgi?id=707250
2013-09-01 17:46:02 -07:00
Jasper St. Pierre
7050b97d94 shaped-texture: Actually fetch rectangles from the blended_region
We checked for the blended region but actually fetched rectangles from
the clip region.

https://bugzilla.gnome.org/show_bug.cgi?id=707090
2013-08-29 18:36:35 -04:00
Jasper St. Pierre
23e9947f7a shaped-texture: Prevent no clip region from being used as an empty clip region
cairo_region_copy, while valid to call on a NULL pointer, gives us an empty
region instead of an infinitely big region, so the interesction won't give
us what we want. Just check for this case explicitly.

https://bugzilla.gnome.org/show_bug.cgi?id=707081
2013-08-29 15:26:14 -04:00
Jasper St. Pierre
ab4c929a07 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,
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=706930
2013-08-28 11:11:34 -04:00
Jasper St. Pierre
c251ab5092 shaped-texture: Use non-deprecated cogl APIs
https://bugzilla.gnome.org/show_bug.cgi?id=706930
2013-08-28 11:11:33 -04:00
Jasper St. Pierre
57258dc1d4 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=706930
2013-08-28 11:11:33 -04:00
Jasper St. Pierre
f1df49ad17 Refactor how shapes are done
As part of Wayland support, we should hold the shape and opaque regions
on the MetaWindow rather than fetching them in the MetaWindowActor, as
this gives us better flexibility as to where the regions are set, and
allows for easier Wayland support.

To make merging easier with the Wayland branch, we also append the _x11
suffix to functions that use the X SHAPE extension to fetch the shaped
regions.

https://bugzilla.gnome.org/show_bug.cgi?id=706930
2013-08-28 11:11:33 -04:00
Jasper St. Pierre
9d8e7371fb window-actor: Use g_clear_pointer 2013-08-28 11:11:04 -04:00
Jasper St. Pierre
84a1b394a1 shaped-texture: Remove an unnecessary set to NULL 2013-08-27 17:18:38 -04:00
Jasper St. Pierre
4ea8b91e0b shaped-texture: Fix indentation 2013-08-27 16:50:25 -04:00
Jasper St. Pierre
8e1e0fc344 shaped-texture: Remove bad comment
We do not assume ownership of the clip region anymore.
2013-08-27 16:50:25 -04:00
Adel Gadllah
6393789345 meta-window-actor: Fix spacing 2013-08-27 21:24:02 +02:00
Adel Gadllah
d0210c1a97 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-27 16:50:38 +02:00
Adel Gadllah
691c107ce9 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-27 16:50:33 +02:00
Adel Gadllah
5b4924c76e 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-27 16:50:28 +02:00
Jasper St. Pierre
576cd87a5b idle-monitor: Fix a warning when a callback removes the user active watch
The user active watch is a one-fire watch, but it is valid in the API
for the callback to explicitly remove the watch itself. In that case,
the watch will be invalid after the user removes it, and the memory
potentially freed. So make sure to not dereference the watch after
the callback is called.

https://bugzilla.gnome.org/show_bug.cgi?id=706825
2013-08-26 16:30:04 -04:00
Tim Lunn
e74ed92993 background: don't save pixbuf in user data
https://bugzilla.gnome.org/show_bug.cgi?id=706777
2013-08-26 18:25:53 +02:00
Giovanni Campagna
eeed3d605b window: ignore skip-taskbar hint on parentless dialogs
Dialogs that don't have a parent should not be skip-taskbar,
otherwise they get lost and there is no way to recover them
(because they're not autoraised when activating the parent),
but toolkits and applications set the hint anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=673399
2013-08-26 17:35:39 +02:00
Giovanni Campagna
a3037a6dd1 MonitorManager: return the new backlight after changing
Modify the interface of ChangeBacklight to return the new value,
to account for rounding to HW limits.

https://bugzilla.gnome.org/show_bug.cgi?id=706729
2013-08-26 17:35:39 +02:00
Rico Tzschichholz
54fc2daa46 build: Add idle-monitor.xml to EXTRA_DIST 2013-08-25 08:59:32 +02:00
Giovanni Campagna
d36f544069 MonitorXrandr: skip CRTC reconfigurations that have no effect
If we're attempting to reconfigure the CRTCs to the same parameter,
skip the X call, as in some drivers a modeset can take time and
cause flicker.

https://bugzilla.gnome.org/show_bug.cgi?id=706672
2013-08-23 17:30:47 +02:00
Giovanni Campagna
d99c0ad384 Fix srcdir != builddir 2013-08-23 16:31:29 +02:00
Giovanni Campagna
387b53977d MetaIdleMonitor: add a DBus interface for the idle monitor
To allow other clients (gnome-session, gnome-settings-daemon)
to monitor user activity, introduce a DBus interface for the
idle monitor inside mutter.

https://bugzilla.gnome.org/show_bug.cgi?id=706005
2013-08-23 15:25:13 +02:00
Giovanni Campagna
c63e5f755f Add a new helper for tracking user idle activity
When running as a wayland compositor, we can't use the xserver's
IDLETIME, because that's updated only in response to X events.
But we have all the events ourselves, so we can just run the timer
in process.

https://bugzilla.gnome.org/show_bug.cgi?id=706005
2013-08-23 15:01:54 +02:00
Colin Guthrie
7476419940 MonitorXrandr: Fix segv when accessing possible_clones
This code requires a double pass and the segv happens later
when trying to iterate over the array.

https://bugzilla.gnome.org/show_bug.cgi?id=706598
2013-08-22 22:10:00 +02:00
Giovanni Campagna
25ad3486a4 MonitorXrandr: fix reading the current DPMS level
Add missing break statements, to avoid falling always through
to the invalid case.

https://bugzilla.gnome.org/show_bug.cgi?id=706582
2013-08-22 16:24:26 +02:00
Florian Müllner
fdfde62a33 tower: Fix erroneous return value
The function's return value is void, not gboolean.
2013-08-21 23:41:28 +02:00
Florian Müllner
4366687b95 window: Fix a compiler warning 2013-08-21 23:41:28 +02:00
Robert Bragg
2b940f6aba 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.
2013-08-21 13:40:46 -04:00
Jasper St. Pierre
f42682711b 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.
2013-08-21 13:40:46 -04:00
Jasper St. Pierre
ad159d3ebd screen: Add _GTK_FRAME_EXTENTS to _NET_SUPPORTED 2013-08-21 13:40:46 -04:00
Alexander Larsson
6980256a42 ui: Disable scaling support in Gtk+
We can't really support the Gtk+ automatic scaling, as to much
code relies on the GdkWindow and XWindow sizes, etc to match.
In order to keep working we just disable the scaling, meaning
we will pick up the larger fonts, but nothing else. Its not
ideal but it works for now.

https://bugzilla.gnome.org/show_bug.cgi?id=706388
2013-08-20 14:27:49 +02:00
Giovanni Campagna
3f2dcf1698 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:21:52 +02:00
Giovanni Campagna
44097c1b37 MonitorManager: emit a DBus signal when we change the display configuration
Using out-of-band notifications from the wayland protocol or from
X is racy, in that the client could ask for the new resources before
we have them.
Instead, with a signal, we are sure that when the client asks for
it, it will get the right values.

https://bugzilla.gnome.org/show_bug.cgi?id=706382
2013-08-20 13:56:52 +02:00
Giovanni Campagna
3a786542c4 MonitorManager: extend the API with physical sizes
These will be needed in the new display panel designs to show
the diagonal length and physical aspect ratio.

https://bugzilla.gnome.org/show_bug.cgi?id=706322
2013-08-19 23:34:04 +02:00
Giovanni Campagna
7d1e149905 Add MetaCursorTracker, a new helper for tracking the cursor sprite
Under X, we need to use XFixes to watch the cursor changing, while
on wayland, we're in charge of setting and painting the cursor.
MetaCursorTracker provides the abstraction layer for gnome-shell,
which can thus drop ShellXFixesCursor. In the future, it may grow
the ability to watch for pointer position too, especially if
CursorEvents are added to the next version of XInput2, and thus
it would also replace the PointerWatcher we use for gnome-shell's
magnifier.

https://bugzilla.gnome.org/show_bug.cgi?id=705911
2013-08-19 16:05:40 +02:00
Rico Tzschichholz
1dcd52838b build: Add xrandr.xml to EXTRA_DIST 2013-08-19 11:39:16 +02:00
Giovanni Campagna
909a6607c5 MonitorXrandr: try harder to get decent product/serial IDs
If the EDID does not include free-form product name and serial
number, use the numeric IDs instead, like gnome-desktop did.

https://bugzilla.gnome.org/show_bug.cgi?id=706233
2013-08-19 09:45:31 +02:00
Giovanni Campagna
015c05fbf6 MonitorXrandr: fix setting gamma ramps
The value passed to XRRCrtcSetGamma must be allocated with
XRRAllocGamma (because it relies on the locations of green and blue),
otherwise garbage is sent on the wire.

https://bugzilla.gnome.org/show_bug.cgi?id=706231
2013-08-18 12:11:42 +02:00
Giovanni Campagna
8ad5ccd2f8 MonitorConfig: switch to the real configuration file
Forgot to do before pushing...
2013-08-18 01:10:00 +02:00
Colin Walters
115cc870c7 build: Fix srcdir != builddir 2013-08-17 19:05:50 -04:00
Giovanni Campagna
3112794d83 MonitorXrandr: update the internal data structures after applying
We were relying on the XRandR events from the X server to update
the configuration, but we were calling meta_monitor_config_update_current()
immediately after, so the MonitorConfig would be updated with the
old configuration (and we would save that to disk!)

https://bugzilla.gnome.org/show_bug.cgi?id=705670
2013-08-18 00:48:31 +02:00
Giovanni Campagna
3528b067d0 MonitorXrandr: follow the right order in applying the new configuration
First disable CRTCs that should be off in the new configuration,
then resize the framebuffer, then enable the new CRTCs.
If we don't do that, and we're making the screen smaller, X complains
with a BadMatch.

https://bugzilla.gnome.org/show_bug.cgi?id=705670
2013-08-18 00:47:53 +02:00
Giovanni Campagna
0986b660be MonitorXrandr: resize the framebuffer prior to setting the CRTC configuration
Otherwise X11 will trim the new configuration and disable outputs
outside the screen.

https://bugzilla.gnome.org/show_bug.cgi?id=705670
2013-08-18 00:47:53 +02:00
Giovanni Campagna
3bb5086173 Monitor: restore correct display name handling
Now that we have the right values from the EDID, we can load
the PNP database and find the proper vendor name, to show in
the control center UI.

https://bugzilla.gnome.org/show_bug.cgi?id=705670
2013-08-18 00:47:53 +02:00
Giovanni Campagna
69467842ab MonitorXrandr: implement correct EDID parsing
To provide valid values for the vendor, product and serial fields
we need to read the EDID and parse it.
Parser kindly provided by gnome-desktop.

https://bugzilla.gnome.org/show_bug.cgi?id=705670
2013-08-18 00:47:53 +02:00
Giovanni Campagna
57077435ed MonitorManager: add EDID properties to the output DBus description
Add "edid-file", if we have one (in the KMS case, where we can point
people to the right sysfs file), or "edid" with inline data.
These are needed by colord to build the default ICC profile for
uncalibrated displays.

https://bugzilla.gnome.org/show_bug.cgi?id=705670
2013-08-18 00:47:53 +02:00
Giovanni Campagna
46de0ed462 MonitorManager: split the XRandR parts in a subclass
Instead of keeping a forest of if backend else ..., use a subclass
and virtual functions to discriminate between XRandR and the
dummy backend (which lives in the parent class togheter with the
common code)

https://bugzilla.gnome.org/show_bug.cgi?id=705670
2013-08-18 00:47:53 +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
bbbcd8c631 MonitorConfig: handle changes in the laptop lid
This way we don't need to track the current and previous
configuration in gnome-settings-daemon, when we already do so
in mutter.

https://bugzilla.gnome.org/show_bug.cgi?id=705670
2013-08-18 00:47:53 +02:00
Giovanni Campagna
3b61b85f2c MonitorManager: add gamma support
Add GetCrtcGamma() and SetCrtcGamma(), that wrap the similarly
named XRandR API. These are used by GnomeRR inside the color
plugin of the control center (and may go away if the color
plugin decides to do something different under wayland)

https://bugzilla.gnome.org/show_bug.cgi?id=705670
2013-08-18 00:47:53 +02:00
Giovanni Campagna
cd20f1bc0b MonitorManager: ignore configuration changes that disable all outputs
If we compute a screen size of 0 in either direction, we crash
later on, as it is invalid for clutter, cogl and X.

https://bugzilla.gnome.org/show_bug.cgi?id=705670
2013-08-18 00:47:53 +02:00
Giovanni Campagna
8b52782ed4 MonitorManager: add support for backlight
GnomeRR needs that too.
The backlight is exported as a normalized 0-100 value, or -1 if not
supported. Clamping to HW limits is handled by the backend.
Changing backlight uses a different method call, to avoid recomputing
the full display configuration every time the user presses the
backlight keys.

https://bugzilla.gnome.org/show_bug.cgi?id=705670
2013-08-18 00:47:53 +02:00
Giovanni Campagna
849050be95 MonitorManager: further extend the dummy backend
The default configuration is extended, which is only possible
if there are as many CRTCs as outputs, so make sure that's true.

Also, add more and bigger modes, so that different sizes will
be chosen for the three outputs.
A nice side effect of this is that with a real 1920x1080 + 1600x900
layout, if you disable the VGA you get a stage that matches the
screen size, which triggers the legacy fullscreen path in the
outside mutter.

https://bugzilla.gnome.org/show_bug.cgi?id=705670
2013-08-18 00:47:52 +02:00
Giovanni Campagna
5c27a91684 MonitorManager: store the presentation mode bit in XRandR
Use a private output property to store if the output is in
presentation mode or not, so that this information is not lost
after the configuration read back from the server.

https://bugzilla.gnome.org/show_bug.cgi?id=705670
2013-08-18 00:34:16 +02:00
Giovanni Campagna
764c472edb MonitorConfig: add support for default configurations
Activate the presentation bit on new hotplugged monitors, while
making a fully extended setup when running for the first time.

https://bugzilla.gnome.org/show_bug.cgi?id=705670
2013-08-18 00:34:16 +02:00
Giovanni Campagna
d0529b7482 MonitorConfig: add CRTC assignment
Ripped off libgnome-desktop, trimming the parts that checked
that the configuration was plausible, as that should be done
in gnome-control-center before asking mutter for a change.

https://bugzilla.gnome.org/show_bug.cgi?id=705670
2013-08-18 00:34:15 +02:00
Giovanni Campagna
8f4621240a MonitorManager: add support for persistent monitor configurations
Add a new object, MetaMonitorConfig, that takes care of converting
between the logical configurations stored in monitors.xml and
the HW resources exposed by MonitorManager.
This commit includes loading and saving of configurations, but
still missing is the actual CRTC assignments and a default
configuration when none is found in the file.

https://bugzilla.gnome.org/show_bug.cgi?id=705670
2013-08-18 00:33:37 +02:00
Giovanni Campagna
e039add240 MonitorManager: add support for DPMS levels
To the XRandR and dummy backend (and as usual the dummy backend
has no effect)

https://bugzilla.gnome.org/show_bug.cgi?id=705670
2013-08-18 00:33:37 +02:00
Giovanni Campagna
dbd8d4d598 MonitorManager: inherit directly from DisplayConfig instead of handling signals
This way we can handle properties too.

https://bugzilla.gnome.org/show_bug.cgi?id=705670
2013-08-18 00:33:37 +02:00
Giovanni Campagna
522542c486 MonitorManager: fix handling of output transform
Read the current transform from XRandR, and expose the transforms
that are really supported on the bus.
The dummy backend now advertises all transforms, since it doesn't
actually apply them.

https://bugzilla.gnome.org/show_bug.cgi?id=705670
2013-08-18 00:33:35 +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
c354e7e81b DisplayConfig: make the dummy backend writable
Add a number of dummy outputs and modes to the dummy backend,
and implement the writing bits.
The only visible effect is that you can change the screen size,
which resizes the output window.

https://bugzilla.gnome.org/show_bug.cgi?id=705670
2013-08-18 00:32:43 +02:00
Giovanni Campagna
bf40409d97 Reverse handling of XRandR events between Screen and MonitorManager
Now MonitorManager does its own handling of XRandR events, which
means we no longer handle ConfigureNotify on the root window.
MetaScreen reacts to MonitorManager::monitor-changed and updates
its internal state, including the new size.

This paves the way for doing display configuration using only
the dummy backend, which would allow testing wl_output interfaces.

https://bugzilla.gnome.org/show_bug.cgi?id=705670
2013-08-18 00:31:10 +02:00
Giovanni Campagna
57d083730e DisplayConfig: add the write side of the API
Implement ApplyConfiguration in terms of XRandR calls.
Error checking is done before actually committing the configuration.

If mutter is using one of the other monitor config backends, an
error is reported and nothing happens.

https://bugzilla.gnome.org/show_bug.cgi?id=705670
2013-08-18 00:31:09 +02:00
Giovanni Campagna
dc242e46c2 Extend the DBus XRandR protocol to expose cloning restriction
Turns out that even if two outputs say that they can be controlled
by a given CRTC, you can't configure them in the same CRTC unless
they are marked as "possible clones" one of the other.
This can further restrict the configuration options, so we need
to expose this limitation in the DBus API.

https://bugzilla.gnome.org/show_bug.cgi?id=705670
2013-08-18 00:22:54 +02:00
Giovanni Campagna
7e1d1003c9 Add the write side of the DBus protocol too
This is just in the documentation for now, to attract wider feedback
before we start looking at how to implement this for real.

https://bugzilla.gnome.org/show_bug.cgi?id=705670
2013-08-18 00:22:54 +02:00
Giovanni Campagna
3bb33d384f Introduce a new DBus interface for display configuration
This new interface will be used by the control center and possibly
the settings daemon to configure the screens. It is designed to
resemble a simplified XRandR, while still exposing all the quirks
of the hardware, so that the panel can limit the user choices
appropriately.

To do so, MetaMonitorMode needs to track CRTCs, outputs and modes,
so the low level objects have been decoupled from the high-level
MetaMonitorInfo, which is used by core and API and offers a simplified
view of HW, that hides away the details of what is cloned and how.
This is still not efficient as it should be, because on every
HW change we drop all data structures and rebuild them from scratch
(which is not expensive because there aren't many of them, but
at least in the XRandR path it involves a few sync X calls)

https://bugzilla.gnome.org/show_bug.cgi?id=705670
2013-08-18 00:22:54 +02:00
Giovanni Campagna
214f31257b Rework and consolidate monitor handling in MetaScreen
Consolidate all places that deal with output configuration in
MetaScreen, which gets it either from XRandR or from a dummy static configuration.
We still need to read the Xinerama config, even when running xwayland,
because we need the indices for _NET_WM_FULLSCREEN_MONITORS, but
now we do it only when needed.

https://bugzilla.gnome.org/show_bug.cgi?id=705670
2013-08-18 00:22:54 +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
Alban Crequy
8c17b670fb keybindings: always acknowledge events to the X server
https://bugzilla.gnome.org/show_bug.cgi?id=666101
2013-08-13 11:18:48 -04:00
Jasper St. Pierre
12d2e1f600 Support _GTK_FRAME_EXTENTS
https://bugzilla.gnome.org/show_bug.cgi?id=705766
2013-08-13 10:40:15 -04:00
Jasper St. Pierre
c20b007985 Reintroduce mutter binary
I accidentally deleted one too many things.
2013-08-13 10:16:01 -04:00
Jasper St. Pierre
ef480e9120 theme: Fix build breakage 2013-08-13 09:50:59 -04:00
Jasper St. Pierre
8c1c77482d Remove old, deprecated utilities that nobody has used in a million years
https://bugzilla.gnome.org/show_bug.cgi?id=704437
2013-08-13 09:39:02 -04:00
Jasper St. Pierre
e633606ca9 menu: Remove support for icon items from the window menu
We don't show these by default, and it uses deprecated API.
This also removes our only use of the stock icons, so remove
those as well.

https://bugzilla.gnome.org/show_bug.cgi?id=704437
2013-08-13 09:39:01 -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
Bastien Nocera
56fb8a81b3 display: Export the timestamp of the event as well
When passing on keybindings, make sure to pass the timestamp
of the event as well as the deviceid and the action.

https://bugzilla.gnome.org/show_bug.cgi?id=704858
2013-07-25 14:23:51 +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
Jasper St. Pierre
b0cf0b2442 display: Fix compilation error
Whoops, I didn't mean to push that last commit, but let's
not break the build.
2013-07-17 21:04:55 -04:00
Jasper St. Pierre
1c569c2d0e Remove application-based preference
It's hardcoded to FALSE.
2013-07-17 21:03:59 -04: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
21fe5be026 display: Ignore _NET_WM_USER_TIME PropertyNotifies
These are spammy as well.

https://bugzilla.gnome.org/show_bug.cgi?id=703970
2013-07-15 12:47:46 -04:00
Jasper St. Pierre
57bc974a57 display: Ignore XSyncAlarmNotify in meta_spew_event
https://bugzilla.gnome.org/show_bug.cgi?id=703970
2013-07-15 12:47:46 -04: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
Florian Müllner
2103ff6a5c window: Don't force attached dialogs to be border-only
Originally attached dialogs did not have a titlebar, which the code
still assumes though it hasn't been true for a while; nowadays, the
actual look of attached dialogs is controlled by the theme.
As GTK+ recently gained the ability to set custom titlebars, we need
to support attached dialogs with either full borders (WM decorations)
or border-only (GTK+ titlebar).
Just remove the left-over assumption to make it work as expected.

https://bugzilla.gnome.org/show_bug.cgi?id=702764
2013-06-24 20:19:33 +02:00
Adel Gadllah
8ab136b7ea window: Make sure override_redirect window have correct monitor info
We need to update window->monitor on override_redirect windows as well, other
wise they may end up with an invalid struct which triggers and assert when
meta_window_is_monitor_sized is called.

https://bugzilla.gnome.org/show_bug.cgi?id=702564
2013-06-24 17:32:22 +02:00
Adel Gadllah
5205821fb9 window: Reuse current pointer position for monitor checks
Avoid a round trip to the xserver we already have the current position
anyway. Querying from the server on every move can cause the compositor to
stall during movement.
2013-06-23 21:24:41 +02:00
Adel Gadllah
7187206ef5 screen: Allow reusing the current position when quering the monitor
Add new api (meta_screen_get_current_monitor_for_pos and
meta_screen_get_current_monitor_info_for_pos) that allow querying the monitor
without a roundtrip by reusing the passed in cursor position.
2013-06-23 21:24:41 +02: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