1
0
Fork 0
Commit graph

4412 commits

Author SHA1 Message Date
Jasper St. Pierre
f3a2bb7779 window: Clean up old_rect handling a tiny bit
We need the old rect for two purposes: to find the x/y in a resize-only
action, and to pass into the constraints code for nefarious purposes.

The constraints code takes a frame rectangle, so we convert the original
client rect into a frame rect, but never convert it back since it's
unused for the rest of the function.

Instead of playing games with the variables, just have two,
separately-scoped variables. One is the client rect, the other is the
frame rect.
2014-05-01 19:50:39 -04:00
Jasper St. Pierre
73e2d7049a window: Rearrange code a tiny bit 2014-05-01 19:50:38 -04:00
Jasper St. Pierre
a6353944f6 constraints: Remove a lie
The orig / new now are about the frame rect, not the inner window
rect.
2014-05-01 19:50:38 -04:00
Jasper St. Pierre
43d6088ebb window: Change meta_window_move_resize_internal to take a MetaRectangle
We construct one anyway, and most callers already pass in a rectangle
the long way around, so why not change the internal API?
2014-05-01 19:13:33 -04:00
Jasper St. Pierre
e3001794f2 window-x11: Clean up formatting a bit more 2014-05-01 19:11:17 -04:00
Jasper St. Pierre
e97ca325e6 window-x11: Clean up a bit 2014-05-01 19:10:48 -04:00
Jasper St. Pierre
c9c6645284 window-x11: Fix a copy/paste error
We need to use the explicitly passed-in gravity here, rather
than the window's existing gravity.
2014-05-01 19:09:36 -04:00
Jasper St. Pierre
57bb297450 window-wayland: Fix interactive resizing from the top/left once more
Ugh. So in the fullscreen case, we need to make sure to specify that
it's a MOVE_ACTION so that we move to the saved position, but we
can't do that in the resizing case since we need to use the resized
rectangle.

The flags are really hurting us here. Perhaps we should make it the
client's responsibility to specify a complete rectangle which we
could resize to; then the weird-o logic would be self-contained in
each front-end.

I'm not convinced this covers all cases, especially when we could have
a dangling weird state pointer, but it fixes our existing two testcases.
2014-05-01 18:59:17 -04:00
Jasper St. Pierre
06ca99c3a3 window: Remove some ugly debug logging 2014-05-01 17:59:50 -04:00
Jasper St. Pierre
4b5593c67f window: Make the x/y position in the requested_rect more accurate
For gravity-based resizing, we need to make sure that the requested
rectangle has the proper x/y position given by the gravity resize,
rather than the bogus root_x_nw / root_y_nw parameter.

Make the test for this more explicit.
2014-05-01 17:59:50 -04:00
Jasper St. Pierre
acb3dc6754 window: Move adjust_for_gravity to window-x11
This removes the weirdness about which edge cases are where in the
move_resize_internal API, and we now always pass in client top-left
coordinates.
2014-05-01 17:59:49 -04:00
Jasper St. Pierre
4c21a46452 window: Move the session restoration and post-manage move_resize to window-x11 2014-05-01 17:59:49 -04:00
Jasper St. Pierre
900ae2c1fa window: Remove the borders parameter from adjust_for_gravity
We can simply use the existing cached borders.
2014-05-01 17:59:49 -04:00
Jasper St. Pierre
01b6445708 window: Simplify adjust_for_gravity 2014-05-01 17:59:49 -04:00
Jasper St. Pierre
292d502205 window: Fix typo in comment 2014-05-01 17:59:49 -04:00
Jasper St. Pierre
adf2e44a82 core: Remove a few unused meta_core functions 2014-05-01 17:59:48 -04:00
Jasper St. Pierre
d456e68375 keybindings: Fix another place we unfreeze on the wrong xdisplay 2014-04-30 09:32:51 -04:00
Jasper St. Pierre
03efa3ccbc keybindings: Make sure to unfreeze the keyboard on the right xdisplay
This fixes keybindings getting "stuck" after being activated in
X11 compositor mode.
2014-04-30 09:32:51 -04:00
Jasper St. Pierre
2101c8357b Move sync_request_* handling mostly to window-x11 2014-04-29 17:58:23 -04:00
Jasper St. Pierre
575963bee7 window: Turn grab_op_begin / grab_op_ended into vfuncs
And move the grab_resize_popup management to the X11 window class,
as this is only used under X11.
2014-04-29 17:58:22 -04:00
Jasper St. Pierre
7726001d43 window: Simplify resize_popup handling 2014-04-29 17:58:22 -04:00
Jasper St. Pierre
e382a4b560 window: Replace manual switch statement for a resizing grab op 2014-04-29 17:58:22 -04:00
Jasper St. Pierre
70713cc7db window: Add some hooks for when grab ops begin / end on windows 2014-04-29 17:58:22 -04:00
Jasper St. Pierre
417090f3fa window: Remove some superfluous uses of window->xwindow 2014-04-29 17:58:21 -04:00
Jasper St. Pierre
9fcc57cdec core: Remove unused function 2014-04-29 17:58:21 -04:00
Jasper St. Pierre
7bf0c77193 window: Move _NET_WM_ALLOWED_ACTIONS setting to window-x11 as well 2014-04-29 17:58:21 -04:00
Jasper St. Pierre
f2328f1105 window: Move meta_window_move_resize_request to window-x11 2014-04-29 17:58:21 -04:00
Florian Müllner
d9a2443e53 Fix crash when cursor theme lookup failed
meta_cursor_reference_from_theme() may return %NULL on failure,
in which case we currently crash when trying to release it.
2014-04-29 22:20:03 +02:00
Jasper St. Pierre
b773898a60 window-wayland: Fix resizing from the top/left once more
Restoring the position in our move_resize_internal implementation
is too late. We need to do it at ack-time, before we hand off the
new position to the constraints code.
2014-04-28 18:22:55 -04:00
Jasper St. Pierre
8461b2c910 window: Move move_resize_wayland to window-wayland.c
The move/resize logic is still busted for top/left resizes... sigh.
2014-04-28 18:22:55 -04:00
Jasper St. Pierre
9b760dbbab window: Remove unused condition
IS_WAYLAND_RESIZE will always result in a RESIZED result, at least.
2014-04-28 18:22:55 -04:00
Jasper St. Pierre
8b0747786a window: Move X11 struts implementation to X11 codepath 2014-04-28 17:34:33 -04:00
Jasper St. Pierre
41235fcb86 keybindings: Remove now-unused meta_screen_grab_all_keys 2014-04-28 17:34:33 -04:00
Jasper St. Pierre
1d5b4e5b2f display: Remove the same checks in end_grab_op 2014-04-28 17:34:32 -04:00
Jasper St. Pierre
6e8d1d79d1 display: Make sure to retrieve the toplevel transient for
If we have multiple modal stacked dialogs, move the top one, not
the immediate parent, which heavily confuses mutter.
2014-04-28 17:34:32 -04:00
Jasper St. Pierre
7cefe91c3c display: Fix tiling when grabbing an attached dialog
It seems we used the wrong variable by accident
2014-04-28 17:34:32 -04:00
Jasper St. Pierre
1ef6a5542a display: Remove extraneous checks for grab_window
We assert a few lines down anyway, so just move the asserts up
and kill the if statement.
2014-04-28 17:34:32 -04:00
Jasper St. Pierre
bc0f7def47 display: Clean up whitespace 2014-04-28 17:34:31 -04:00
Jasper St. Pierre
f0175d1234 window: Don't reset pending_compositor_effect too early
With our surface_mapped strategy, implement_showing might not
change whether the window has been shown or not, and thus we
might end up clearing pending_compositor_effect before the window
is mapped.

Only clear pending_compositor_effect when the effect has actually
been used.
2014-04-28 16:59:34 -04:00
Jasper St. Pierre
eb0c4db46d keyboard: Don't use a grab interface for sending key events 2014-04-28 16:30:51 -04:00
Jasper St. Pierre
19e97ec567 keyboard: Remove start_grab / end_grab
It's unused.
2014-04-28 16:30:50 -04:00
Jasper St. Pierre
ce5c029509 window-wayland: Make sure to save where the position for server-initiated resizes
For the server-initiated resize case, like unmaximize or some forms
of tiling, we dropped the x/y of the server-assigned rectangle on the
floor, which meant the surface didn't move to where it needed to be in
that case. Now, save it internally, and combine it with the dx/dy passed
in during attaches to figure out where we actually need to be.

Make sure to only use it for when we send out a configure notify. We
should use the passed in rectangle for other scenarios, like a
client-initiated resize.

This fixes incorrect surface placement after unmaximization.
2014-04-28 16:23:38 -04:00
Jasper St. Pierre
647743aa5f Revert "window-wayland: Don't enter the only-moving path for Wayland
resizes"

We're going to use the old code structure now.

This reverts commit 23ae11043f.
2014-04-28 16:23:38 -04:00
Jasper St. Pierre
e94f169d4e Revert "window-wayland: Make sure to save where the position for server-initiated resizes"
This is wrong for client-initiated resizes now.

This reverts commit e6b0525c70.
2014-04-28 16:23:38 -04:00
Jasper St. Pierre
e6b0525c70 window-wayland: Make sure to save where the position for server-initiated resizes
For the server-initiated resize case, like unmaximize or some forms
of tiling, we dropped the x/y of the server-assigned rectangle on the
floor, which meant the surface didn't move to where it needed to be in
that case. Now, save it internally, and combine it with the dx/dy passed
in during attaches to figure out where we actually need to be.

This fixes incorrect surface placement after unmaximization.
2014-04-28 16:11:10 -04:00
Jasper St. Pierre
23ae11043f window-wayland: Don't enter the only-moving path for Wayland resizes
We'll be adding additional code here for "correct" moving soon, so
we need to make sure not to do it for Wayland resizes.
2014-04-28 16:11:09 -04:00
Jasper St. Pierre
78657dafca window-wayland: Clean up a bit 2014-04-28 16:11:09 -04:00
Jasper St. Pierre
0f47eae33a window-wayland: Split an if statement in two 2014-04-28 16:11:09 -04:00
Jasper St. Pierre
2209eac2bf constraints: Make meta_window_constrain take window geometry rects
Remove extend_by_frame and unextend_by_frame. Use a dumb hack in
window.c to translate into window geometry in back. We'll soon track
all rectangles in MetaWindow in terms of the window geometry.
2014-04-28 16:11:09 -04:00
Jasper St. Pierre
aed6d4fbb7 default: Remove the maximize effect
It looks awful, and doesn't work with Wayland at all for some
reason, which means that maximize seems to "hang" for half a
second. Just trash it.
2014-04-28 15:20:49 -04:00
Jasper St. Pierre
270c7abd3c default: Remove the unmaximize implementation
It does nothing.
2014-04-28 15:20:48 -04:00
Jasper St. Pierre
e2bd15541b default: Remove unused internal state tracking 2014-04-28 15:20:48 -04:00
Jasper St. Pierre
9607513e62 backend-x11: Fix cursor position under nested 2014-04-28 13:29:45 -04:00
Jasper St. Pierre
18730f2a5e backend-x11: Take grabs on the stage window
This means that grabs will be reported with respect to the
stage window, and that our event coordinates will be more
correct under nested.
2014-04-28 13:29:31 -04:00
Adel Gadllah
4e584c2cf0 display: Don't call x11 backend code when running native
https://bugzilla.gnome.org/show_bug.cgi?id=729044
2014-04-27 20:24:15 +02:00
Jasper St. Pierre
d1619e4f53 wayland-pointer: Remove the conditional around the surface actor too
The actor should always exist.
2014-04-27 10:39:19 -04:00
Adel Gadllah
c8d0a66921 wayland-surface: Ignore bufferless damage
Instead of letting a buggy client kill us.
2014-04-27 16:18:09 +02:00
Adel Gadllah
dd4d6af185 wayland-surface: Only call process_damage when we have any damage
This fixes a crash when a client commits a surface
without attaching a buffer.
2014-04-27 16:12:02 +02:00
Adel Gadllah
657318d4d3 meta-wayland-pointer: Remove the surface->window conditional 2014-04-25 20:38:24 +02:00
Adel Gadllah
f051e05b0a meta-wayland-pointer: Transform coordinates relative to the surface_actor
Not the window_actor ..
2014-04-25 20:36:46 +02:00
Rico Tzschichholz
ca75513880 prefs: Add center-new-windows setting 2014-04-25 15:26:24 +02:00
Jasper St. Pierre
63f1a10e33 compositor: Don't select for weird events on the COW/stage
Talking it over with Owen, we weren't sure why this was here.

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

Why we did it on the COW, nobody knows. Maybe copy/paste bugginess?
2014-04-24 16:26:21 -04:00
Jasper St. Pierre
14f839c53c window: Only grab/ungrab buttons/keys on X11 windows 2014-04-24 16:26:21 -04:00
Jasper St. Pierre
ebb6847bd1 ui: Don't use grab ops for grab negotation
Grab operations are now always taken on the backend connection, and
this breaks GTK+'s event handling.

Instead of taking a grab op, just do the handling ourselves. The
GTK+ connection will get an implicit grab, which means pointer /
keyboard events won't be sent to the rest of mutter, which is good.
2014-04-24 13:36:40 -04:00
Jasper St. Pierre
c5d4f4a245 backend-x11: Split out event translation to another method
Keep the indentation from getting too hairy.
2014-04-24 12:12:54 -04:00
Jasper St. Pierre
a027937ccc backend-x11: Set the proper coordinates on the spoofed device event
When we click on a window with a passive grab, then the event_x
and event_y will be relative to that window, instead of relative to
the stage, which means that picking will be wrong.

Forcibly using root_x / root_y breaks nested mode. Nested mode is
a testing mode that should be replaced by a DRI3-enabled Xephyr,
though. It's getting too hairy to support properly.
2014-04-24 12:12:54 -04:00
Jasper St. Pierre
925075ddaf compositor: Don't select for stage events on the UI X11 connection 2014-04-24 12:12:53 -04:00
Jasper St. Pierre
41de208f31 compositor: Also ungrab the VCP when beginning a modal
XXX: This should not be needed. We need to figure out why
there's a grab on the UI connection.
2014-04-24 11:26:12 -04:00
Jasper St. Pierre
c8e3b52160 keybindings: Simplify 2014-04-24 11:26:11 -04:00
Jasper St. Pierre
2c53919462 keybindings: Remove two extra error traps 2014-04-24 11:26:11 -04:00
Jasper St. Pierre
a6f3534ff0 display: Set the cursor theme on the backend display as well 2014-04-24 11:26:11 -04:00
Jasper St. Pierre
490f1a6249 display: Simplify cursor theme handling 2014-04-24 11:26:10 -04:00
Jasper St. Pierre
5b83bfb1db display: Make sure to ungrab the pointer before starting a grab op
Now that we grab devices on the X11 connection, we can run into
cross-connection issues. Since GTK+ frames are on the UI connection,
they'll get the passive grab when we click on them. Forcibly ungrab
on GTK+'s connection before attempting to take a grab on the backend
connection ourselves.
2014-04-24 11:26:10 -04:00
Jasper St. Pierre
1ef06207a4 keybindings: Add two extra checks for key grab binding 2014-04-24 11:26:10 -04:00
Jasper St. Pierre
18d609ad6d window: Don't use clutter_stage_get_default
It doesn't work, for the same reasons.
2014-04-23 17:01:51 -04:00
Adel Gadllah
c95c501a5b meta-wayland-surface: Clip damage to buffer dimensions
A client can send us damage that exceeds the buffer size, protect against that
by clipping the damage to the buffer's region.
2014-04-23 22:32:17 +02:00
Jasper St. Pierre
8c5da24401 keybindings: Fix keybindings
Attach them to the backend's X11 connection.

This breaks the overlay key state machine for native right now.
We'll fix it back up soon.
2014-04-23 16:29:34 -04:00
Jasper St. Pierre
01a773ed5a backend-x11: Don't use clutter_stage_get_default
It turns out Clutter doesn't actually set the stage as the default
when creating a new one, so this creates a new stage that then dies.
2014-04-23 16:01:02 -04:00
Jasper St. Pierre
2435d132ac Revert "Update to latest xdg-shell protocol"
This reverts commit eed03d38b0.

This was pushed by accident.
2014-04-23 16:01:02 -04:00
Jasper St. Pierre
72c65cbff0 display: Take passive grabs on the backend connection 2014-04-23 15:43:34 -04:00
Jasper St. Pierre
97074ccdad backend-x11: Fix leak of the event data 2014-04-23 15:43:34 -04:00
Jasper St. Pierre
6111bb9dec backend-x11: Adapt a consistent naming scheme for the event struct 2014-04-23 15:43:34 -04:00
Jasper St. Pierre
eed03d38b0 Update to latest xdg-shell protocol 2014-04-23 14:23:13 -04:00
Jasper St. Pierre
e9eb3c32a9 compositor: Move event spoofing code to MetaBackendX11
This is now where we handle device events.
2014-04-23 14:23:13 -04:00
Jasper St. Pierre
61b714c666 compositor: Remove "exclusive is exclusive" codepath
We now handle input events in the backend.
2014-04-23 14:23:13 -04:00
Jasper St. Pierre
e9263d25b9 compositor: Take modal grabs through the backend as well 2014-04-23 14:23:12 -04:00
Jasper St. Pierre
d590626017 compositor: Select for input on the output window the right display 2014-04-23 14:23:12 -04:00
Jasper St. Pierre
fdd43fc2d9 backend-x11: Add KeyPress / KeyRelease to mask 2014-04-23 14:23:12 -04:00
Jasper St. Pierre
4cbf420b4b idle-monitor-xsync: Clean up includes
Conflicts:
	src/backends/x11/meta-idle-monitor-xsync.c
2014-04-23 13:27:11 -04:00
Jasper St. Pierre
fd373948d2 idle-monitor-xsync: Retrieve your xdisplay from the backend 2014-04-23 13:27:11 -04:00
Jasper St. Pierre
1dc8a7eca3 monitor: Remove handle_xevent as a generic method 2014-04-23 12:15:12 -04:00
Jasper St. Pierre
861cfc23df x11: Make sure to handle RANDR events from the right connection 2014-04-23 12:15:12 -04:00
Jasper St. Pierre
86368e7e07 backend: Add grab_device / ungrab_device
This makes sure that we take active grabs on the correct connection.
Passive grabs are still broken.
2014-04-23 12:15:12 -04:00
Jasper St. Pierre
f42184ded8 display: Pull the grab cursor from the cursor tracker
This might look silly, but just wait...
2014-04-23 12:15:12 -04:00
Jasper St. Pierre
af515732b0 display: Clean up set_grab_op_cursor 2014-04-23 12:15:12 -04:00
Jasper St. Pierre
98a1573bee cursor: Save the original MetaCursor a cursor came from
So we can recreate it as a server-side cursor
2014-04-23 12:15:12 -04:00
Jasper St. Pierre
1762436775 display: Remove the screen from set_grab_op_cursor 2014-04-23 12:15:12 -04:00
Jasper St. Pierre
4fd017d23d display: Always grab the root window
This grab needs to move to the backend, where we won't be able to
discriminate between different windows
2014-04-23 12:15:12 -04:00
Jasper St. Pierre
2f6ce4783b display: Remove grab_xwindow from the public API 2014-04-23 12:15:12 -04:00
Jasper St. Pierre
c6296aa17f cursor: Make load_cursor_on_server public 2014-04-23 12:15:12 -04:00
Jasper St. Pierre
b501ca5a24 cursor: Remove cursor tracker from API 2014-04-23 12:15:11 -04:00
Jasper St. Pierre
10ac86b950 backend: Clean up slightly 2014-04-23 12:15:11 -04:00
Jasper St. Pierre
def097359c cursor-renderer: Remove bogus assert 2014-04-23 10:24:26 -04:00
Jasper St. Pierre
6c743dad88 xrandr: Rewrite to be based on the X11 display connection 2014-04-23 10:24:26 -04:00
Jasper St. Pierre
274047c3f8 backend-native: Make sure to chain up to the parent post_init 2014-04-23 10:24:26 -04:00
Jason Ekstrand
e04e9aac39 Fix an uninitialized variable warning 2014-04-22 21:09:06 -04:00
Jasper St. Pierre
59fc9d832b wayland: Clean up surface creation 2014-04-22 18:27:44 -04:00
Jasper St. Pierre
0bf5c831d5 wayland: Remove unused list of surfaces 2014-04-22 18:27:44 -04:00
Jasper St. Pierre
777a6d4570 surface: Merge version logic inline 2014-04-22 18:27:43 -04:00
Jasper St. Pierre
003ff3d255 wayland: Fix header file style 2014-04-22 18:27:43 -04:00
Jasper St. Pierre
88040d6b8a wayland: Have a consistent _init pattern for subcomponents 2014-04-22 18:27:43 -04:00
Jasper St. Pierre
eaf85ddec9 wayland: Split outputs to another file 2014-04-22 18:25:34 -04:00
Jasper St. Pierre
fa2e1e4eda wayland-seat: Clean up includes 2014-04-22 18:25:34 -04:00
Jasper St. Pierre
5752079cbb launcher: Finish the rename
Not sure how I missed this one...
2014-04-22 18:25:22 -04:00
Jasper St. Pierre
7014dc5368 launcher: Rename methods a bit 2014-04-22 17:42:25 -04:00
Jasper St. Pierre
fdaeb0cf9c launcher: Fix indentation 2014-04-22 17:42:13 -04:00
Jasper St. Pierre
59415bf49f launcher: Unconditionally set the FD
We only open weston-launch if we're in the native backend,
so we don't need to check here.
2014-04-22 17:42:13 -04:00
Jasper St. Pierre
3c3b94921f launcher: Move activate_session abstraction into the launcher code
login1 has a separate ActivateSession request, so put it here so
that we don't have to modify any backend code.
2014-04-22 17:42:13 -04:00
Jasper St. Pierre
0d9fa24be4 launcher: Fix up includes 2014-04-22 17:42:13 -04:00
Jasper St. Pierre
9a98ec81d7 Rename meta-weston-launch to meta-launcher
We're going to replace this with a login1 implementation soon enough.
2014-04-22 17:41:48 -04:00
Jasper St. Pierre
d0142d6ab6 backend: Remove unnecessary include 2014-04-22 17:00:53 -04:00
Jasper St. Pierre
dd440e64da backends: Add a native cursor renderer 2014-04-22 16:56:02 -04:00
Jasper St. Pierre
a1ba480c8a cursor-renderer: Rewrite HW cursors to be cleaner 2014-04-22 16:56:02 -04:00
Jasper St. Pierre
93600d6166 cursor-renderer: Fix HW cursors
We need to make sure that we update the HW cursor if we disable
it for some reason.
2014-04-22 16:56:02 -04:00
Jasper St. Pierre
33f3ca7fba weston-launch: Go through the MetaBackend to force-update the cursor 2014-04-22 16:56:02 -04:00
Jasper St. Pierre
d27e267382 cursor: Retrieve the GBM device from the MetaBackend
Not the MetaCursorTracker.
2014-04-22 16:56:02 -04:00
Jasper St. Pierre
91784d87b6 Move the painting of the cursor on the stage out of the cursor renderer
This logic is now well-contained the stage. This is the start of us
moving to backend-specific cursor renderers.
2014-04-22 16:56:02 -04:00
Jasper St. Pierre
2769683521 Rename MetaWaylandStage to MetaStage and put in compositor/ 2014-04-22 16:56:02 -04:00
Jasper St. Pierre
6072e981a8 wayland: Kill extra includes to meta-wayland-stage.h
No idea why these are still included at all...
2014-04-22 16:56:02 -04:00
Jasper St. Pierre
e21677c782 cursor-renderer: Kill a warning
This can happen during early initialization. We should have a
better initialization plan.
2014-04-22 16:56:01 -04:00
Jasper St. Pierre
168ede9374 compositor: Create the MetaWaylandStage here 2014-04-22 16:56:01 -04:00
Jasper St. Pierre
a0d608e083 wayland: Remove the stage destroy hook
We assert fail / segfault when pressing the "X" button anyway, so
I don't think it does us too much good.
2014-04-22 16:56:01 -04:00
Jasper St. Pierre
326740e00f Move the cursor renderer to the backend 2014-04-22 16:56:01 -04:00
Jasper St. Pierre
eac6e9ed41 cursor-tracker: Improve symmetry between two paths 2014-04-22 16:56:01 -04:00
Jasper St. Pierre
4ea9a28eee cursor-renderer: Remove the MetaScreen
It's unused.
2014-04-22 16:56:01 -04:00
Jasper St. Pierre
ca11b88fcd screen: Remove no-op statement
This was at one time necessary to create the cursor tracker, but
now that it's global we don't need it anymore.
2014-04-22 16:56:01 -04:00
Jasper St. Pierre
20a0eb9809 Require the XSync and XShape extensions at build-time
It's been long enough. We can mandate support for these, at least
at build-time. The code doesn't actually compile without either
of these, so just consider that unsupported.
2014-04-22 14:17:09 -04:00
Jasper St. Pierre
d8dfe4e4ad display: Remove the RENDER extension requirement
Surprisingly, it's completely unused across all of the codebase.
2014-04-22 14:17:09 -04:00
Jasper St. Pierre
28666da6a1 backend-x11: Simplify XSync initialization handling a bit 2014-04-22 14:17:08 -04:00
Jasper St. Pierre
bb4896f1af plugin: Don't pass events to Clutter
We do this ourselves in the backend
2014-04-22 12:44:33 -04:00
Jasper St. Pierre
a17b86dfbe native: Install our pointer constrainment hook after Clutter initializes
Otherwise, the evdev device manager won't be around.
2014-04-22 12:44:33 -04:00
Jasper St. Pierre
d9450c46b9 cursor: Always use names for cursors
Rather than sometimes using names and sometimes using glyphs.
2014-04-22 12:44:33 -04:00
Jasper St. Pierre
e80c37f857 cursor: Don't require an xdisplay to load cursors on the client 2014-04-22 12:44:33 -04:00
Jasper St. Pierre
ef44cc5a53 cursor-tracker: Have one global cursor tracker
Now that we have a global MetaScreen, we can simply have a global
MetaCursorTracker as well. Keep the get_for_screen() API around for
compatibility, though.
2014-04-22 12:44:33 -04:00
Jasper St. Pierre
7c0d75e34f cursor: Don't access the cursor tracker from the screen directly
Go through the get_for_screen getter.
2014-04-22 12:44:30 -04:00
Jasper St. Pierre
ee812e3fe0 cursor-tracker: Split a simple method out 2014-04-22 12:44:27 -04:00
Jasper St. Pierre
52cf9104d9 window: Make the Move / Resize window menu items behave like the keybind
The Alt+F7 and Alt+F8 keybinds for moving and resizing windows allow you
to move and resize the window off the screen, so allow the same for the
menu items as well, since they're marked with the same accelerator.

https://bugzilla.gnome.org/show_bug.cgi?id=728617
2014-04-22 10:26:03 -04:00
Jasper St. Pierre
3d091e514d backend: Poll events from the host X11 server ourselves
I was accidentally pulling events from the Xwayland server under
nested for the idle monitor, which is wrong. Whoops.
2014-04-22 10:26:03 -04:00
Jasper St. Pierre
3c0ca1f2af wayland-stage: Fix a race condition early in init
If Xwayland takes too long to start up, Clutter can choose to draw, at
which point we'll crash because the MetaDisplay hasn't initialized yet.
2014-04-22 10:26:03 -04:00
Jasper St. Pierre
9a6f5e115d Revert "wayland-stage: Use the C setter for cursor-visible"
This reverts commit d1a31952de.

Whoops, I did not mean to push this one.
2014-04-21 21:07:47 -04:00
Jasper St. Pierre
731e1ed74f wayland-stage: Remove unused variable 2014-04-21 21:07:47 -04:00
Jasper St. Pierre
eba5648c27 wayland-stage: Add missing include
Again, had it locally, forgot to amend.
2014-04-21 21:07:47 -04:00
Jasper St. Pierre
d1a31952de wayland-stage: Use the C setter for cursor-visible
This makes meta_wayland_stage_new(); synonymous with g_object_newv(...);
2014-04-21 21:05:23 -04:00
Jasper St. Pierre
13a444482a wayland-stage: Don't use the Wayland seat to find the cursor tracker
Simply look it up on the seat itself.
2014-04-21 21:05:23 -04:00
Jasper St. Pierre
9d780bca7a wayland-stage: Cut down on dependencies 2014-04-21 21:05:23 -04:00
Jasper St. Pierre
b6a80934d6 backend: Move pointer constrainment code to native backend 2014-04-21 21:05:23 -04:00
Jasper St. Pierre
75b5d15598 backend: Clarify comment 2014-04-21 21:05:23 -04:00
Jasper St. Pierre
c44b1d730d backends: Move MonitorManager creation to MetaBackend as well 2014-04-21 20:25:21 -04:00
Jasper St. Pierre
48dc544bef backends: Move most of the code from meta_backend_init into the subclasses 2014-04-21 20:25:21 -04:00
Jasper St. Pierre
31d744195d backends: Build MetaBackend subclasses for each backend 2014-04-21 20:25:21 -04:00
Jasper St. Pierre
00ea9bf14b backends: Start on an initial MetaBackend object
This isn't great so far -- all we did is put the idle monitors here
instead. We'll soon have separate backend subclasses for the two
backends.
2014-04-21 20:25:21 -04:00
Jasper St. Pierre
f3ee9be4cb idle-monitor: Use the XSync idle monitor under X11 nested 2014-04-21 20:25:20 -04:00
Jasper St. Pierre
2d6bcf3885 monitor-manager: Remove debugging META_DEBUG_MULTIMONITOR hook
It's outdated and incorrect: META_TYPE_MONITOR_MANAGER is now an
abstract class.
2014-04-21 20:25:20 -04:00
Jasper St. Pierre
d189ddcc86 Split out the code that renders the code into a MetaCursorRenderer
Right now, this is the same exact same mess it's always been, but
it will be fixed up soon with backend-specific renderers.
2014-04-21 20:25:20 -04:00
Jasper St. Pierre
18770aaa63 cursor: Add an explicit getter for the gbm device
We want to move this to a new MetaCursorRenderer class.
2014-04-21 20:25:20 -04:00
Jasper St. Pierre
adf0d08585 events: Clean up a bit 2014-04-21 12:15:23 -04:00
Jasper St. Pierre
813206393a events: Handle move/resize grab ops as a first special case 2014-04-21 12:14:29 -04:00
Jasper St. Pierre
7c0a3dfeb8 window: Remove unused prototype 2014-04-21 12:14:29 -04:00
Jasper St. Pierre
cd4e6fcdee display: Remove unused grab variables 2014-04-20 13:06:41 -04:00
Jasper St. Pierre
2f9c601ae4 display: Clean up end_grab_op 2014-04-20 13:06:41 -04:00
Jasper St. Pierre
bec3db3068 events: Add explicit break
This doesn't particularly matter, since we fall through into a default
case that does nothing right below, but this matches the other paths
and it prevents us from falling into a trap if we add other event types
below.
2014-04-20 13:00:51 -04:00
Jasper St. Pierre
cef2745bc0 window: Properly end grab ops started from a keybind / menu
If we start a grab op from a keybind / menu, we'll handle the
ButtonPress and drop the grab then, never giving the window a chance
to handle what it needs to do before the grab is dropped.

This means that if you use Alt+F7 to move a window around, move it
to a side-tiling or maximization area, and then left-click, it will
just hang there in the sky.
2014-04-20 13:00:51 -04:00
Jasper St. Pierre
064ef09c99 window: Remove is_window_root
The entire point of it was to check whether the window was on the
right screen. Since we don't handle multiple screens anymore, we
don't need to check anything anymore.
2014-04-20 13:00:51 -04:00
Jasper St. Pierre
9ca0349c2b display: Use grab_op_is_moving_or_resizing 2014-04-20 13:00:51 -04:00
Jasper St. Pierre
f9305be450 display: Don't bother checking for mouse/keyboard separately
Just use our new is_moving_or_resizing method.
2014-04-20 12:03:25 -04:00
Jasper St. Pierre
6c9aa15814 display: Rename is_mouse_only to is_mouse 2014-04-20 12:03:24 -04:00
Jasper St. Pierre
d09116ebce display: Rename meta_grab_op_is_mouse to is_moving_or_resizing
is_mouse actually checks for all combinations of moving/resizing
grab ops, which is quite confusing. Just rename it.
2014-04-20 12:03:24 -04:00
Jasper St. Pierre
beca90a689 display: Expose meta_grab_op_is_mouse_only
And use it properly in some event handling code.
2014-04-20 12:03:24 -04:00
Jasper St. Pierre
e55dd4e3f4 display: Rename META_GRAB_OP_WAYLAND_CLIENT to WAYLAND_POPUP
We're going to introduce other grab ops soon.
2014-04-20 12:03:24 -04:00
Jasper St. Pierre
02c31ac069 data-device: Clean up slightly 2014-04-20 12:03:24 -04:00
Jasper St. Pierre
3f375c9426 pointer: Remove get_focus_surface
Yeah, I was wrong, it doesn't improve code clarity.
2014-04-20 12:03:24 -04:00
Jasper St. Pierre
258112d6a7 display: Remove COMPOSITOR from mouse/keyboard grab ops
Looking at the code paths where is_mouse / is_keyboard are used,
all of them should never be run when dealing with a COMPOSITOR
grab op, since they're filtered out above or the method is just
never run during that time.

It's confusing that COMPOSITOR is in here, and requires us to
be funny with other places in code, so just take it out.
2014-04-20 12:03:24 -04:00
Jasper St. Pierre
ceb0f1005d pointer: Repick on update, not on handle_event
pointer->current needs to always be the surface under the pointer,
even when we have a grab. We do need to make sure we keep the focus
surface the same even when we have a grab, though, so add logic
for that.
2014-04-20 12:03:24 -04:00
Adel Gadllah
a378faf495 stack-tracker: Fix unitialized variable 2014-04-20 16:02:48 +02:00
Jasper St. Pierre
c9e99ebbbf pointer: Move update up
It seems that I forgot or messed this up in one of my reshufflings.
2014-04-18 18:56:01 -04:00
Jasper St. Pierre
020f209c45 pointer: Split out the code that gets the proper focus surface as well 2014-04-18 18:56:01 -04:00
Jasper St. Pierre
45df3e41c5 pointer: Split out the code that sets the focus surface 2014-04-18 18:56:01 -04:00
Jasper St. Pierre
1a723954fc pointer: Only the focus_surface should only be influenced by the grab
... not the normal current. That should *always* be the surface under
the pointer, regardless of events.
2014-04-18 18:56:01 -04:00
Jasper St. Pierre
3e554efc70 pointer: Clean up repick_for_event a bit 2014-04-18 18:56:01 -04:00
Jasper St. Pierre
d68da0b8cf pointer: Merge update_current_focus and repick_for_event
In order to correctly fix the issue to make sure we only set the
focused surface to NULL during a grab, but not the current surface,
we need to merge update_current_surface back into repick_for_event
so we have more control over the behavior here.
2014-04-18 18:56:01 -04:00
Jasper St. Pierre
de7a644656 pointer: Unset the window cursor when we do a pick
... not when we do an update.

We only repick when we handle events, not when we update. Perhaps
this is a mistake.

Since update runs before handle_event, this means that when we
drop a grab, update will notice the NULL surface, since we haven't
repicked after the event, and then we'll repick the correct surface.
The end result is that you see a root cursor after a grab ends,
rather than the correct window cursor.

This doesn't fix it, since the current surface becomes NULL when
we start the grab. But it does make the code here more correct when
we fix that bug.
2014-04-18 18:56:01 -04:00
Jasper St. Pierre
16bcbd1a34 pointer: Reindent 2014-04-18 18:56:01 -04:00
Jasper St. Pierre
29439f8de2 wayland-surface: Fix offset with window dragging
The grab_x / grab_y here were converted from fixed integers to
floats, but we forgot to update one place in the code that used
them as fixed integers.
2014-04-18 18:23:27 -04:00
Jasper St. Pierre
97a69cee5a wayland-surface: Simplify move_double_buffered_state
The majority of the data we can simply copy from one to the other.
2014-04-18 18:23:27 -04:00
Jasper St. Pierre
2e2dd247ce wayland: Rename pending_surface_state => pending
This matches what's normally done.
2014-04-18 18:15:41 -04:00
Jasper St. Pierre
de6054d557 wayland: Remove an extraneous variable 2014-04-18 18:15:41 -04:00
Jasper St. Pierre
db56a7cecb wayland: Rename DoubleBufferedState to PendingState
I was talking with other people and they became confused at the
term "double-buffered", since we were also talking about
double-buffering in general, e.g. swapping between two buffers.

Instead, we'll adapt the "pending state" nomenclature that we
already use for the field / variable names.
2014-04-18 18:15:36 -04:00
Jasper St. Pierre
f92c1af24a wayland-surface: Merge actor_surface_commit back in
Since we do it unconditionally now, the code flows better
if it's inline with commit_double_buffered_state.
2014-04-18 15:43:26 -04:00
Jasper St. Pierre
4ab71ec942 wayland: Make subsurfaces reactive 2014-04-18 12:26:31 -04:00
Jasper St. Pierre
2748661f63 pointer: Remove our own position tracking
Use the coords inside ClutterInputDevice instead.
2014-04-18 12:26:31 -04:00
Jasper St. Pierre
aee074b11d pointer: Remove unused field 2014-04-18 12:26:31 -04:00
Jasper St. Pierre
5f29b8c206 pointer/keyboard: Rearrange slightly 2014-04-18 12:26:30 -04:00
Jasper St. Pierre
92340fd8da display: Kill #if 0'd support for _NET_RESTACK_WINDOW requests
The code has been dead and broken for a long, long time now.
2014-04-18 10:12:11 -04:00
Jasper St. Pierre
7c6c4d63c5 seat: Move the keyboard resource creation over to MetaWaylandKeyboard 2014-04-17 19:15:53 -04:00
Jasper St. Pierre
5d43e33032 seat: Don't set the data device key focus on get_keyboard creation
It's not necessary, as we don't use anything from the protocol
keyboard at all.
2014-04-17 19:15:53 -04:00
Jasper St. Pierre
45a8a3f490 seat: Move pointer event handling to MetaWaylandPointer as well
Now everything that deals with the pointer is inside meta-wayland-pointer.c
2014-04-17 19:15:53 -04:00
Jasper St. Pierre
bdf55bc674 seat: Rewrite event handling in terms of MetaWaylandPointer 2014-04-17 19:15:53 -04:00
Jasper St. Pierre
e15c260e56 seat: Group CLUTTER_SCROLL handling together with other pointer events 2014-04-17 19:15:53 -04:00
Jasper St. Pierre
65ed8a817d seat: Don't save the current stage ourselves
ClutterInputDevice already saves it.
2014-04-17 19:15:53 -04:00
Jasper St. Pierre
a8d2dfd14f seat: Don't require an event to repick()
We always pass NULL, and anywhere where we want to pass an event
should be handled internally.
2014-04-17 19:15:53 -04:00
Jasper St. Pierre
e02bf13206 seat: Remove incorrect comment above repick 2014-04-17 19:15:53 -04:00
Jasper St. Pierre
4b7d77864a seat: Move update_pointer to MetaWaylandPointer 2014-04-17 19:15:52 -04:00
Jasper St. Pierre
72e4d42267 seat: Reorder handle_event helpers near handle_event 2014-04-17 19:15:52 -04:00
Jasper St. Pierre
1abdd7be10 seat: Move pointer interface over to MetaWaylandPointer 2014-04-17 19:15:52 -04:00
Jasper St. Pierre
f3d88ca1d1 seat: Rewrite the pointer interface in terms of MetaWaylandPointer 2014-04-17 19:15:52 -04:00
Jasper St. Pierre
15d89d451f seat: Move update_cursor_surface to the end
It's now only a public API.
2014-04-17 19:15:52 -04:00
Jasper St. Pierre
4510b82361 seat: Move set_cursor_surface and all that tracking to MetaWaylandPointer 2014-04-17 19:15:52 -04:00
Jasper St. Pierre
ae0853ed86 seat: Move cursor storage to MetaWaylandPointer 2014-04-17 19:15:52 -04:00
Jasper St. Pierre
76544ff6e1 seat: Rewrite get_pointer / get_keyboard in terms of MetaWaylandPointer 2014-04-17 19:15:52 -04:00
Jasper St. Pierre
dde96951a7 seat: Rewrite handle_scroll in terms of MetaWaylandPointer 2014-04-17 19:15:52 -04:00
Jasper St. Pierre
24eb737858 keyboard: Remove the useless return value of init 2014-04-17 19:15:52 -04:00
Jasper St. Pierre
ddc7938961 keyboard: Reformat 2014-04-17 19:15:51 -04:00
Jasper St. Pierre
4f2dc77ec3 keyboard: Reorder
The correct order is:

init
release
update
handle_event
set_focus
start_grab
end_grab
other stuff
2014-04-17 19:15:51 -04:00
Jasper St. Pierre
678fa52ae1 seat: Reformat 2014-04-17 19:15:51 -04:00
Jasper St. Pierre
1be97f3d59 seat: Reorder 2014-04-17 19:15:51 -04:00
Jasper St. Pierre
30ecd7c770 keyboard: Gobble up key events whenever we have a focused surface
If we have a focused surface, we need to eat up key events, not
just if we have a non-empty focus resource list. The latter would
happen if we have a focused client but it never called get_keyboard.
2014-04-17 19:15:51 -04:00
Jasper St. Pierre
0dd27edb91 xwayland: Remove some unused includes 2014-04-17 16:23:37 -04:00
Jasper St. Pierre
6a44f04b51 xwayland: Stop using UNIX signals for readiness
The latest Xorg / Xwayland has support for -displayfd being used
in conjunction with an explicit display number. Use that to know
when the X server is ready, rather than UNIX signals, because
they're UNIX signals.
2014-04-17 16:23:37 -04:00
Jasper St. Pierre
745134e066 xwayland: Rename sp to something a bit more handy
We also want to create a socketpair for -displayfd instead
of using signals.
2014-04-17 16:23:37 -04:00
Jasper St. Pierre
72b1a2837d xwayland: Clean up display finding code
Split out and make it more manageable.
2014-04-17 16:23:37 -04:00
Jasper St. Pierre
e5ab4f13f1 xwayland: Put the filename in the error message 2014-04-17 16:23:37 -04:00
Jasper St. Pierre
14deeef8a7 xwayland: Use %m instead of explicit strerror 2014-04-17 16:23:37 -04:00
Jasper St. Pierre
57cc68096b cursor-tracker: Kill unused variable 2014-04-17 16:23:37 -04:00
Jasper St. Pierre
d7ee5cf33d cursor: Remove the theme_cursor cache
It's unused.
2014-04-17 13:03:27 -04:00
Florian Müllner
a2fb2c05ae window: Queue a fullscreen check when moving between monitors
We track changes to windows fullscreen state and stacking order
to determine a monitor's in-fullscreen state, but missed the
obvious case of moving a fullscreen window between monitors.

https://bugzilla.gnome.org/show_bug.cgi?id=728395
2014-04-17 18:30:16 +02:00
Florian Müllner
abd0ac2cc3 keybindings: Handle switch-to-workspace-{up,down,left,right} again
Commit 585fdd781c not only removed the tabpopup, but set invalid
handlers (a.k.a. NULL) for those shortcuts; add back handling of
basic handling of those shortcuts by switching instantly without any
popups.

https://bugzilla.gnome.org/show_bug.cgi?id=728423
2014-04-17 17:05:38 +02:00
Jasper St. Pierre
8c0ef829c9 pointer/keyboard: Unset the entire focus when the surface is destroyed
Otherwise, we'll end up with dangling parts in our resource list.
2014-04-16 19:04:58 -04:00
Jasper St. Pierre
eb1c9175f9 wayland: Move the RESULT_RESIZED code to the proper place
We need to set this when we update window->rect, not when we simply
send out a configure event.
2014-04-16 16:31:45 -04:00
Jasper St. Pierre
f25243e121 wayland: Don't move the window when we're simply sending out a configure
If we're sending out a configure event, we can't immediately move the
window; we need to instead wait to apply the new position when the
client sends a new buffer.
2014-04-16 16:31:45 -04:00
Jasper St. Pierre
c1f4352683 window: Add proper interpretation of dx/dy
dx/dy should be against the regular window's rect, and need to
be ignored when we're resizing. Instead, we use gravity to anchor
the window's new rectangle when resizing.
2014-04-16 16:31:45 -04:00
Jasper St. Pierre
0797206cc2 window: Use the window's rect for checking whether this is a resize
The expected_rect is going to die.
2014-04-16 16:31:45 -04:00
Jasper St. Pierre
260b6d02f2 wayland: Simplify the move/resize code
The old protocol is out of date and broken for resizing at the
top/left. This is still as broken, but a lot simpler.
2014-04-16 16:31:45 -04:00
Florian Müllner
0440765cb7 keybindings: Expose new keybindings in g-c-c 2014-04-16 21:41:26 +02:00
Elad Alfassa
40214b72bf keybindings: Add keybindings to switch to last workspace
When using dynamic workspaces, the last workspaces can vary, so it makes sense
to have a keybinding to go directly to it.

https://bugzilla.gnome.org/show_bug.cgi?id=659288
2014-04-16 21:41:26 +02:00
Jasper St. Pierre
339a78718d pointer/keyboard: Support more than one focused resource
Sophisticated clients, like those using ClutterGtk, will have more
than one focused resource per client, as both Clutter and GDK will
ask for a wl_pointer / wl_keyboard. Support this naturally using
the same "hack" as Weston: multiple resource lists, where we move
elements from one to the other.
2014-04-16 15:31:53 -04:00
Jasper St. Pierre
f1034d0459 pointer/keyboard: Remove focus_resource_listener
In order to support multiple pointers for the same client, we're
going to need to kill it.

This will cause crashes for now, but will be fixed by the next
commit.
2014-04-16 15:30:42 -04:00
Jasper St. Pierre
edfaf3de49 pointer/keyboard: Stop using focus_resource for anything unessential 2014-04-16 15:30:41 -04:00
Jasper St. Pierre
bbec66c2d8 pointer/keyboard: Surfaces should always have resources
There's no possible way that they shouldn't.
2014-04-16 15:27:08 -04:00
Jasper St. Pierre
339b856d84 pointer: Clean up a tiny bit 2014-04-16 15:27:07 -04:00
Jasper St. Pierre
7560aaee73 pointer: Make sure to care about FFM even if the client didn't get a
resource
2014-04-16 15:27:03 -04:00