1
0
Fork 0
Commit graph

378 commits

Author SHA1 Message Date
Jasper St. Pierre
d931af33c4 display: Init X11 events separately 2014-08-15 13:46:53 -04:00
Jasper St. Pierre
a0e3c05428 display: Don't bother recording the grab timestamp
It's not used anywhere.
2014-08-15 13:09:18 -04:00
Jasper St. Pierre
586f118279 keybindings: Move the button grabs to here as well 2014-08-14 17:35:23 -04:00
Jasper St. Pierre
ef363e9d2e display: Simplify the regrab on focus mode 2014-08-14 17:35:23 -04:00
Jasper St. Pierre
9fa77acb8c display: Move devirtualize_modifiers into keybindings
It's mostly only used here.
2014-08-14 17:35:23 -04:00
Jasper St. Pierre
5f0fab2156 Conditionalize Wayland support again 2014-08-13 20:28:22 -04:00
Jasper St. Pierre
e935b52e51 display: Move composite version checks here 2014-08-13 19:32:39 -04:00
Rui Matos
7d54631ebf backends: Make MetaBackend available to introspection
This moves meta-backend.h under meta/ and, for now, just exposes to
introspection the methods that we actually need in gnome-shell.

https://bugzilla.gnome.org/show_bug.cgi?id=734301
2014-08-07 11:31:59 +02:00
Rui Matos
6af48de0b8 Use libX11's Xkb* API unconditionally
At this point there shouldn't be any system capable of running mutter
that doesn't have it and we're introducing functionality like setting
the keymap that has an hard requirement on it.

https://bugzilla.gnome.org/show_bug.cgi?id=734301
2014-08-06 14:53:10 +02:00
Carlos Garnacho
70aee2d95e display: cancel wayland client touches when the compositor is grabbed
When a compositor grab begins, clients will stop receiving events, so any
ongoing sequence at that time must be cancelled.

https://bugzilla.gnome.org/show_bug.cgi?id=733631
2014-07-24 18:07:30 +02:00
Carlos Garnacho
41fdc4ac2e display: Add meta_display_is_pointer_emulating_sequence()
This function tells the obvious on X11, and implements a similar mechanism
on wayland to determine the "pointer emulating" sequence, or one to stick
with when implementing single-touch behavior.

https://bugzilla.gnome.org/show_bug.cgi?id=733631
2014-07-24 18:05:56 +02:00
Carlos Garnacho
6c22759d29 display: Add forgotten meta_display_cancel_touch 2014-07-23 18:37:51 -04:00
Carlos Garnacho
25b6a40ad4 display: Implement gesture-induced touch cancellation for wayland
On wayland, touches are initially both handled by the compositor and sent
to clients, proceeding to cancellation on clients only after the compositor
claims the sequence for itself. Implement the cancellation detail through
MetaGestureTracker::state-changed.

https://bugzilla.gnome.org/show_bug.cgi?id=733631
2014-07-24 00:17:04 +02:00
Jasper St. Pierre
679844f791 display: Call meta_window_grab_op_ended after everything else is reset
This properly sends the resizing state to the correct Wayland surface.
2014-07-17 16:03:01 -04:00
Adel Gadllah
029673d0ee Revert "backend-x11: Take the touch grab on the stage window"
This reverts commit 3b85e4b2b9.

This breaks touch support; reverting would break wayland
(is what this patch tried to fix; we should find a better solution
that works on both).
2014-07-17 17:18:08 +02:00
Owen W. Taylor
3a57f843d5 Add a framework for restarting the compositor with nice visuals
The current GNOME Shell Alt-F2 restart looks very messy and also
provides no indication to the user what is going on. We need to
restart the compositor to switch in and out of stereo mode, so
add a framework for doing this more cleanly:

Additions:

 meta_restart(): restarts the compositor with a message
 MetaDisplay::show-restart-message: signal the embedding
    shell to show a message
 MetaDisplay::restart: signal the embedding shell to restart
    itself.
 meta_is_restart(): indicates whether the current instance is a
                    restart so we can suppress login animations.

A helper program meta-restart-helper holds the composite overlay
window up during the restart to avoid visual artifacts.

https://bugzilla.gnome.org/show_bug.cgi?id=733026
2014-07-16 18:09:25 -04:00
Jasper St. Pierre
3b85e4b2b9 backend-x11: Take the touch grab on the stage window
So we don't get assert fails when touching the screen on mutter nested.
2014-07-14 17:24:31 -04:00
Jasper St. Pierre
55354f5c38 Take the touch grab in MetaBackendX11
This means that it won't trigger when we're running as a Wayland
compositor, which will cause a few warnings and possibly more
brokenness.
2014-07-14 09:41:10 -04:00
Jasper St. Pierre
f9d33b2efc display: Add an extra check inside meta_display_close
For clarity of what the expected input to this function is.
2014-07-13 11:37:31 -04:00
Jasper St. Pierre
2185904fcb display: Use a local here instead of the global the_display
This will make it easier to split some of this functionality out into
other subfunctions.
2014-07-13 11:35:38 -04:00
Jasper St. Pierre
d7d8c92a9a Remove unused Wayland includes 2014-07-13 11:35:01 -04:00
Owen W. Taylor
88a7790d44 MetaDisplay: remove meta_display_grab()/ungrab()
Now that we have two connections to the X server, the idea of a
ref-counted server grab that might be held across extended portions
of code is very dangerous since we might try to use the backend
connection while the frontend connection is grabbed.

Replace the only usage (which was local) with direct
XGrabServer/XUngrabServer usage and remove the meta_display_grab()
API.

https://bugzilla.gnome.org/show_bug.cgi?id=733068
2014-07-11 13:39:07 -04:00
Florian Müllner
06a31992e3 screen: Tweak workspace initialization (again)
Commit 8100cefd4c fixed a crash during workspace initialization by
tweaking the startup sequence; as a result, the plugin (like gnome-shell)
is now started before workspaces are fully initialized, which breaks
some reasonable assumptions (like always having an active workspace).
This is particularly problematic considering that the code making those
assumptions is not necessarily our own (extensions!), so return to
fully initialize workspaces before the compositor again.
At the same time, make sure to only call meta_workspace_activate()
once during initialization to avoid reintroducing the crash.

https://bugzilla.gnome.org/show_bug.cgi?id=732695
2014-07-10 17:50:59 +02:00
Jasper St. Pierre
09610daea1 gesture-tracker: Don't pass an autodeny-timeout
Just use the default value of 250.
2014-07-08 13:27:38 -04:00
Jasper St. Pierre
82dce6758a window: Remove pending pings in unmanage
This makes sure that we see them for Wayland clients as well, and don't
time out and crash when we're accessing an invalid window / surface.

Spotted-by: Rui Matos <tiagomatos@gmail.com>
2014-07-08 12:17:08 -04:00
Carlos Garnacho
23b074481a display: Set an X11 passive touch grab on the root window
Touch events will be caught first by the compositor this way,
whenever the MetaGestureTracker notifies of the accepted/rejected
state of a sequence, XIAllowTouchEvents() will be called on it
accordingly, so it is handled exclusively by the compositor or
punted to clients.
2014-07-08 11:21:29 -04:00
Carlos Garnacho
a9ba98686f display: Add a global MetaGestureTracker 2014-07-08 11:21:28 -04:00
Jasper St. Pierre
89cdfc9194 display: Use G_SOURCE_CONTINUE / G_SOURCE_REMOVE 2014-06-12 17:46:23 -04:00
Jasper St. Pierre
ad60ea9e0e display: Use meta_window_has_pointer instead of XQueryPointer 2014-06-12 17:46:23 -04:00
Florian Müllner
8100cefd4c screen: Split workspace initialization from meta_screen_new()
Since commit 8b2b65246a, we assume that the compositor always
exists. Alas, the assumption is wrong - the compositor is currently
initialized after the screen, but meta_screen_new() itself may
call a compositor function if initialization involves a workspace
switch (which will happen when meta_workspace_activate() is called
more than once and for different workspaces - or in other words,
when _NET_CURRENT_DESKTOP is set and not 0).
So carefully split out the offending bits and only call them after
the compositor has been initialized.

https://bugzilla.gnome.org/show_bug.cgi?id=731332
2014-06-11 23:35:34 +02:00
Jasper St. Pierre
12fc394b92 display: Fix the logic for moving attached dialogs
If we have a tree of a window, a non-attached dialog, and then an
attached dialog, we want to move the second window, not the attached
dialog or the topmost. In other words, we want to move the first
non-attached window, or the first "freefloating window".

This happens in Firefox, whose Preferences dialog is freefloating,
but suboptions of those are modal dialogs.
2014-06-11 16:42:05 -04:00
Rico Tzschichholz
f5a4e996a8 display: Remove the screen from get_tab_list 2014-06-03 14:40:15 +02:00
Florian Müllner
d380d30ef4 Update (allow-none) annotations
The annotation has been deprecated in favor of (nullable) and/or
(optional).
2014-05-28 21:55:03 +02:00
Jasper St. Pierre
6e06648f7a window: Refactor all move/resize operations to be in frame rect space
For Wayland, we want to have everything possible in terms of the frame
rect, or "window geometry" as the Wayland protocol calls it, in order
to properly eliminate some flashing when changing states to fullscreen
or similar.

For this, we need to heavily refactor how the code is structured, and
make it so that meta_window_move_resize_internal is specified in terms
of the frame rect coordinate space, and transforming all entry points
to meta_window_move_resize_internal.

This is a big commit that's hard to tear apart. I tried to split it
as best I can, but there's still just a large amount of changes that
need to happen at once.

Expect some regressions from this. Sorry for any temporary regression
that this might cause.
2014-05-27 15:44:34 -04:00
Jasper St. Pierre
4acb902423 window: Correct the anchoring of drag moving / resizing
Now that meta_window_move_resize and friends act in frame rect
coordinates, we need to convert the initial grab_anchor_window_pos
storage to be in frame rect coordinates as well.
2014-05-27 15:44:33 -04:00
Jasper St. Pierre
4053c92abf Rework timestamp pinging
If a window temporarily goes unresponsive, and then returns later, we
should hide the kill dialog that we showed to the user.
2014-05-20 15:59:15 -04:00
Jasper St. Pierre
8640982e68 Convert window menus to a compositor implementation 2014-05-17 15:16:23 -04:00
Jasper St. Pierre
71544fbf4e display: Replace set_grab_op_cursor with update_cursor
Now that we don't have to regrab to change the cursor, since it's
simply the cursor on the root window, all we have to do is update
the cursor on the screen.
2014-05-14 09:20:49 -04:00
Jasper St. Pierre
f57b0726a0 cursor-tracker: Remove the grab cursor
We expect that meta_screen_set_cursor while grabbed will properly
set the cursor on the root window. Make sure this works by simply
always using the root cursor when we have an active grab.
2014-05-13 16:20:03 -04:00
Jasper St. Pierre
7b3cdc8f96 display: Correct check for grab_window_buttons
When we're a Wayland compositor, we get all the events, no exceptions,
so we don't need to grab.

This was masking focusing and raising issues under nested that showed
up under native.
2014-05-08 14:19:22 -04:00
Giovanni Campagna
1427d20922 MetaDisplay: free the wayland windows table at close
Like we do for the XID table.

https://bugzilla.gnome.org/show_bug.cgi?id=729732
2014-05-07 19:04:54 +02:00
Jasper St. Pierre
5d310e06ba display: Remove some more unnecessary NULL checks
Instead, replace them with another assert precondition.
2014-05-02 09:37:01 -04:00
Jasper St. Pierre
25a16c3379 Remove trailing whitespace 2014-05-02 09:34:48 -04:00
Florian Müllner
a6601e92aa display: Don't grab transient's parent unconditionally
Since commit 6e8d1d79d, move operations are always performed for
the (toplevel) parent of all transient, which is just plain silly
if the dialog is not actually attached to its parent (either because
the dialog is not modal or the setting is disabled).
2014-05-02 12:27:39 +02:00
Jasper St. Pierre
7726001d43 window: Simplify resize_popup handling 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
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
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