1
0
Fork 0
Commit graph

1482 commits

Author SHA1 Message Date
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
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
eed03d38b0 Update to latest xdg-shell protocol 2014-04-23 14:23:13 -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
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
Jason Ekstrand
e04e9aac39 Fix an uninitialized variable warning 2014-04-22 21:09:06 -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
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
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
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
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
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
Adel Gadllah
a378faf495 stack-tracker: Fix unitialized variable 2014-04-20 16:02:48 +02: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
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
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
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
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
86100936d9 util: Don't check whether zenity supports options
Doing this synchronously means that zenity tries to initialize GTK+.
Under Wayland, that will try to connect back to mutter as a display
server. We're waiting on zenity to exit, and zenity is waiting for
a connection response. Deadlock.

Simply assume that zenity will support all the options we feed it,
since it should be the correct version. Perhaps we should replace
our use of zenity with a simple helper binary that we know will
have all the right options if this still isn't good enough.
2014-04-15 17:20:42 -04:00
Rui Matos
6219ae782a events: Update current_time as best as we can on misc X events
Instead of always setting it to CurrentTime.
2014-04-15 20:38:26 +02:00
Rui Matos
1169e104cb events: Bypass both gtk+ and the compositor for SelectionClear
We can't do any further processing after this since we have already
freed most of our structures including the MetaDisplay.
2014-04-15 20:38:24 +02:00
Florian Müllner
87bec99a0a window: Allow activation on non-active workspaces with proper timestamps
Our focus stealing prevention is still mostly inherited from metacity;
in particular, a (non-transient) window that is not on the current
workspace will not be given focus. This behavior made sense in the
GNOME 2 days, where workspaces were separated much more strictly.
However this is no longer the case in GNOME 3 - activating a launcher
will switch workspaces if necessary, and so will the app switcher.
There is no good reason to not do the same for other user actions
like clicking a URL or activating a search result, so allow activation
of windows on non-active workspaces if a proper timestamp is supplied,
assuming that this is a strong enough indication that we are dealing
with a legitimate user action.

https://bugzilla.gnome.org/show_bug.cgi?id=728018
2014-04-15 17:23:24 +02:00
Florian Müllner
5defe574d7 window: Treat CurrentTime as legal timestamp in activation
Effectively we have been accepting CurrentTime timestamps for years,
but still complained about "stupid pagers" when encountering them;
just accept that we will never limit treating 0 timestamps as current
time to pagers.

https://bugzilla.gnome.org/show_bug.cgi?id=728018
2014-04-15 17:23:22 +02:00
Jasper St. Pierre
59541dfa14 window: Initialize the result here
The vfuncs simply |= their results into the result variable, so we
need to make sure we start out with nothing.
2014-04-12 10:08:36 -07:00
Jasper St. Pierre
becce7afa0 stack: Fix a crasher from a buffer overrun
The code that restacks X11 windows at the end first tracks any
old windows we know about, and then handles any windows created.

It starts when it ended, and then walks forwards and then
back looking for the first X11 window it doesn't know about.
However, when there aren't any X11 windows, it flies off the end
of the array and starts looking through random memory.

When it finds the X11 window, it then goes through and then tries
to restack the remaining windows according to how we've sorted
them.

Unfortunately, META_WINDOW_CLIENT_TYPE_X11 is 0, which is quite
common in random memory we have lying around, so we enter that
path and then just crash.

Fix the buffer overrun by adding the proper bounds check to the
search.

You can easily reproduce this by opening a menu while bloatpad
is full-screen. Why it only crashes when full-screen and not
when a standard window, I have no idea.
2014-04-12 08:15:58 -07:00
Jasper St. Pierre
862d57d459 stack: Fix indentation 2014-04-12 08:15:54 -07:00
Jasper St. Pierre
bb62f49c98 display: Wayland client grabs should not block Wayland input focus
This fixes menu issues with GTK+.
2014-04-12 00:24:27 -07:00
Jasper St. Pierre
b4293d46a6 display: Rewrite grab_op_should_block_wayland to be a tiny bit clearer 2014-04-12 00:24:27 -07:00
Jasper St. Pierre
30d534f17e display: Rename grab_op_is_wayland to grab_op_should_block_wayland
The idea here is that while we take a WM-side grab, like a compositor
grab or a resizing grab, we need to remove the focus from the Wayland
client.

We make a special exception for CLICKING operations, because these
are really an internal state machine while you're pressing on a button
inside a frame, and in this case, we need to not kill the focus.
2014-04-12 00:24:26 -07:00
Jasper St. Pierre
d004f3f990 display: Don't special-case is_wayland grabs when we sync_input_focus
meta_wayland_seat_repick already detects this case and reacts
accordingly.
2014-04-12 00:24:26 -07:00
Giovanni Campagna
c55f64fdf2 x11: fix enter/leave events for frames
We need to pass all events on frames to GTK, even if we handled
them internally, to make sure that the hover state is properly
updated.
2014-04-12 03:16:40 +02:00
Bastien Nocera
d53e04f4c8 Name all timeouts and idles
Better names can be used once we make more use of them.

https://bugzilla.gnome.org/show_bug.cgi?id=727979
2014-04-10 18:59:46 +02:00
Nirbheek Chauhan
b37223b9bb window: Use guint8 for opacity internally
Except while reading _NET_WM_WINDOW_OPACITY, opacity is between 0 and 255. With
guint8, we'll get compiler warnings if arbitrary int values are passed.

https://bugzilla.gnome.org/show_bug.cgi?id=727874
2014-04-10 18:15:25 +02:00
Jasper St. Pierre
954677dcbd window: Make sure to end the grab even if the last action was a snap
This seems to be a cherry-pick failure while we were switching event
handling around. This matches what the master branch does.
2014-04-09 12:40:13 -07:00
A. Walton
4396ac809b 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
2014-04-09 12:20:07 -07:00
Jasper St. Pierre
797c46ba7d events: Fix event handling for window menus under X11
We need to pass XI_Enter / XI_Leave events for GTK+ windows to GTK+,
rather than eating them.
2014-04-09 11:38:49 -07:00
Jasper St. Pierre
2f229c3928 display: Remove code to calculate the above-tab keycode
We always know it will be KEY_GRAVE + 8.
2014-04-07 17:56:00 -04:00
Jasper St. Pierre
a730361d6c Use libxkbcommon keysym names everywhere 2014-04-07 17:56:00 -04:00
Jasper St. Pierre
db058d4a81 keybindings: Use xkb_keysym_get_name 2014-04-07 17:56:00 -04:00
Jasper St. Pierre
15cf804dbc keybindings: Eliminate the use of the stored modmap
We can simply check the XKB keysym here to see if it's a modifier.
2014-04-07 17:55:59 -04:00
Jasper St. Pierre
b38b037092 keybindings: Don't bother saving num_lock / caps_lock in MetaDisplay
It's unused outside of this one function.
2014-04-07 17:55:58 -04:00
Jasper St. Pierre
42bcad6549 display: Ignore the modmask passed into meta_display_begin_grab_op
A careful analysis of mutter's codebase shows that nothing actually
passes anything but 0 to this. gnome-shell has one instance, but it's
most likely a mistake.

Remove the grab_mask field and the one place in keybindings.c that uses it.

The parameter to begin_grab_op is left in for API compatibility reasons.
2014-04-07 17:45:52 -04:00
Jasper St. Pierre
b0ea0afd2f display: Remove meta_display_get_ignored_modifier_mask
It's unused, in both here and in gnome-shell.
2014-04-07 17:16:29 -04:00
Jasper St. Pierre
1d08d75108 keybindings: Rename and move keysym_to_keycode
This makes it more what it's actually doing.
2014-04-07 16:02:08 -04:00
Jasper St. Pierre
4daf20483d keybindings: Handle META_KEY_ABOVE_TAB in get_keycodes_for_keysym
We're going to switch to get_keycodes_for_keysym for the other
bindings, so add that special case here.
2014-04-07 16:01:24 -04:00
Jasper St. Pierre
96b6dcec01 display: Kill some bad whitespace 2014-04-07 16:00:17 -04:00
Jasper St. Pierre
9fe5a3b407 keybindings: Fix style 2014-04-07 16:00:17 -04:00
Jasper St. Pierre
a7d4713393 accel-parse: Add a notice about where the code came from 2014-04-07 11:25:16 -04:00
Jasper St. Pierre
4d4ecae2a1 accel-parse: Clean up trailing whitespace 2014-04-07 11:24:23 -04:00
Jasper St. Pierre
545c3b6678 accel-parse: Clean up error handling
Now that we have the code in-tree, we can change the API to actually
report an error rather than checking afterwards.
2014-04-07 11:21:36 -04:00
Jasper St. Pierre
e70f336a09 accel-parse: Use libxkbcommon for keysym parsing
This kills our dependency on GTK+ / GDK entirely.
2014-04-07 11:19:41 -04:00
Jasper St. Pierre
806f1742ac accel-parse: Switch code to output MetaVirtualModifier directly 2014-04-07 11:19:40 -04:00
Jasper St. Pierre
0dc63f395d accel-parse: Remove support for <Release> 2014-04-07 11:15:01 -04:00
Jasper St. Pierre
616f1a09b1 accel-parse: Add keycode parsing as well 2014-04-07 11:15:01 -04:00
Jasper St. Pierre
50e69109b6 accel-parse: Integrate Above_Tab parsing code directly into our copy 2014-04-07 11:15:01 -04:00
Jasper St. Pierre
242784d3e4 accel-parse: Copy the code from GTK+ in-tree
We can't use GTK+ for accelerator parsing under Wayland, since we
don't want to go through Xwayland to make that happen.
2014-04-07 11:14:35 -04:00
Jasper St. Pierre
0466fe9301 Move meta_ui_parse_accelerator into core/
We're currently using GTK+ for this, but we'll stop doing that fairly
quickly and instead just copy the GTK+ code in-tree.
2014-04-07 10:59:46 -04:00
Jasper St. Pierre
b9e9595e8b errors: Kill off meta_error_trap_push_with_return
It isn't special; it's just an alias for meta_error_trap_push.
2014-04-07 10:37:03 -04:00
Jasper St. Pierre
75de29f5f7 errors: Remove vestigals of old error trap implementation 2014-04-07 10:37:03 -04:00
Jasper St. Pierre
e2b24092d6 events: Don't pass any X input events on to Clutter / GTK+ 2014-04-07 10:37:02 -04:00
Jasper St. Pierre
0e6570b09b events: Early exit when we get a SN notification event
Nothing else needs to see this.
2014-04-07 10:37:02 -04:00
Jasper St. Pierre
be02fa1120 xwayland: Switch to the new Xwayland DDX 2014-04-02 13:24:57 -04:00
Jasper St. Pierre
3c404c5db3 wayland: Replace make_toplevel / window_unmanaging with set_window
The make_toplevel / window_unmanaging interface has never made
a lot of sense to me. Replace it with set_window, which does
effectively the same thing.

It's still not perfect in the case of XWayland, but I don't think
XWayland will ever make me happy.
2014-04-02 11:41:07 -04:00
Jasper St. Pierre
ab6bc76bfd Move edid-parse to backends/ 2014-04-01 14:35:04 -04:00
Jasper St. Pierre
bce1d5117b Start creating different subdirectories for each backend 2014-03-31 23:44:47 -04:00
Jasper St. Pierre
5bcc78498f Move MetaLauncher to meta-backend 2014-03-31 23:44:46 -04:00
Jasper St. Pierre
89b931435d Move meta_clutter_init into a new file
We'll use this to get the initialization between the Wayland and
X11 compositor codepaths back in sync.
2014-03-31 23:44:25 -04:00
Jasper St. Pierre
e22e9f5df5 main: Refactor some code slightly 2014-03-31 22:55:13 -04:00
Jasper St. Pierre
2cf185b4e4 Move mutter-Xatomtype to x11/ 2014-03-31 22:13:12 -04:00
Jasper St. Pierre
229360b248 Start molding out a new src/backends/ dir
Right now this just has all of the files in one directory. We'll
be introducing more structure to this in the future, and build
a proper backend system.
2014-03-31 22:11:00 -04:00
Jasper St. Pierre
ccced506ed Rename monitor => meta-monitor-manager 2014-03-31 22:05:24 -04:00
Jasper St. Pierre
28b9160c01 Rename monitor-config => meta-monitor-config 2014-03-31 22:05:22 -04:00
Jasper St. Pierre
ba6584a0d7 Move monitor-config to its own header file 2014-03-31 22:04:38 -04:00
Jasper St. Pierre
2a0289a216 Move the dummy monitor manager to his own subclass / file 2014-03-31 21:52:32 -04:00
Jasper St. Pierre
f6a73bcf22 cursor: Do less work if we don't have a connection to GBM at all 2014-03-31 19:14:56 -04:00
Jasper St. Pierre
59e064f610 cursor: Split out code that loads an image into a GBM buffer 2014-03-31 19:14:56 -04:00
Jasper St. Pierre
ba131626c2 cursor: Always use cogl_wayland_texture_2d_new_from_buffer
It makes our life so much easier.
2014-03-31 19:14:56 -04:00
Jasper St. Pierre
30ebf46aa4 cursor: Reindent 2014-03-31 19:14:56 -04:00
Jasper St. Pierre
da27735265 cursor: Refactor code to load cursor images out
We're going to make MetaCursorReference specialized and per-backend soon.
2014-03-31 19:14:55 -04:00
Jasper St. Pierre
78dbf8cb56 cursor: Split out the structure for the actual textures / buffers out
This will allow us to have a MetaCursorReference 'subclass' that's
lazily loaded. We currently always load all the images.

The long-term plan is to have a subclass for each "backend" and only
have CoglTexture as a common denominator. For the nested X11 backend,
we use XDefineCursor on our stage window. For the Wayland backend, we
would use set_cursor on our stage surface. For the native backend, we
would use the GBM code that's there right now.

The CoglTexture is there to be a "shared fallback" between all devices,
and also for the get_sprite API.

The odd man out is the X11 compositor case. For that, we need to move
the responsibility of setting the final cursor image out of
MetaCursorTracker, and simply have it be about tracking the used sprite
image and pointer position.
2014-03-31 19:09:08 -04:00
Jasper St. Pierre
f4e299ca46 cursor: Split out code that frees the MetaCursorReference 2014-03-31 18:27:20 -04:00
Jasper St. Pierre
f95f2b0c6d cursor-tracker: Make set_root_cursor take a MetaCursorReference 2014-03-31 18:27:20 -04:00
Jasper St. Pierre
fe42a4eb4e screen: Move XDefineCursor on the root window here
This is really an X11 front-end thing, so it doesn't belong in the
cursor tracker, which is a back-end thing.
2014-03-31 18:27:20 -04:00
Jasper St. Pierre
565883dadb screen: Refactor update_cursor a bit 2014-03-31 18:27:19 -04:00
Jasper St. Pierre
be60e4f6e7 cursor-tracker: Make set_window_cursor take a MetaCursorReference as well 2014-03-31 18:27:19 -04:00
Jasper St. Pierre
fa60824096 cursor-tracker: Make set_grab_cursor take a MetaCursorReference 2014-03-31 18:27:19 -04:00
Jasper St. Pierre
0efb0b47eb cursor: Move cursor caching layer to meta_cursor_reference_from_theme 2014-03-31 18:27:18 -04:00
Jasper St. Pierre
0f810a4e21 cursor: Refactor out code that loads from XcursorImage 2014-03-31 18:27:18 -04:00
Jasper St. Pierre
383d4c7e4e cursor: Introduce accessors for the texture / GBM bo
We want to make this private, and have MetaCursorReference be
backend-defined, with the texture possibly loaded on demand.

We can't make the definition of MetaCursorReference truly private yet
because of the XFixes cursor. A victim of MetaCursorTracker trying to
do too many things at once...
2014-03-31 18:27:18 -04:00
Jasper St. Pierre
21425b5833 cursor-tracker: Split the code that loads MetaCursorReferences out
The plan here is to move the usage of these interfaces to the consumer,
and then slam the code into backends.
2014-03-31 18:27:18 -04:00
Jasper St. Pierre
863569b702 cursor-tracker: Split out the code that updates the new cursor 2014-03-31 18:27:17 -04:00
Jasper St. Pierre
5f52f55916 cursor-tracker: Start moving some code to a new file
I want the MetaCursorTracker to mostly be about retrieving cursor
information. Start moving the code that loads cursor images to a
new file, MetaCursor. Eventually, MetaCursorTracker's APIs will
all take MetaCursorReferences, and we can have a clean backend
split here.
2014-03-31 18:27:17 -04:00
Jasper St. Pierre
0aec98cf02 idle-monitor: Hack out assert fail
It seems that we're getting XSyncAlarmNotify events here as a Wayland
compositor for some reason. Just hack this one out for now.
2014-03-31 18:27:17 -04:00
Jasper St. Pierre
b64d14ff4a cursor-tracker: Rearrange code
Move take_texture closer to where it's used, and add hot_x / hot_y args.
2014-03-31 15:22:31 -04:00
Jasper St. Pierre
08a8254deb cursor-tracker: Move ref_count to the top 2014-03-31 15:22:31 -04:00
Jasper St. Pierre
11de01741c cursor-tracker: Add a comment about what previous is
It confused me a bit.
2014-03-31 15:22:31 -04:00
Jasper St. Pierre
a7ea2cd365 cursor-tracker: Shadowing is bad, don't do it 2014-03-31 15:22:31 -04:00
Jasper St. Pierre
a15a4faff0 cursor-tracker: Remove unused constants 2014-03-31 15:22:30 -04:00
Jasper St. Pierre
b93176d89a cursor-tracker: Kill off an unused include 2014-03-30 23:06:01 -04:00
Jasper St. Pierre
f842ea6d15 idle-monitor: Make the rest of the implementation-specific fields private 2014-03-30 23:04:39 -04:00
Jasper St. Pierre
422f2e5fe6 idle-monitor: Kill off an unused field 2014-03-30 23:00:10 -04:00
Jasper St. Pierre
3961f291e4 idle-monitor: Move the alarms field to the XSync backend
For whatever reason, this hash table was in the generic
implementation section instead of the XSync implementation,
even though it's only used by the XSync implementation.

Use it as a first pass of things to move over.
2014-03-30 22:55:54 -04:00
Jasper St. Pierre
61d8b35254 idle-monitor: Move watch implementations to be private to the subclass 2014-03-30 22:55:03 -04:00
Jasper St. Pierre
78457cf7b4 idle-monitor: Create separate subtypes for backend-specific idle monitors
The separation here isn't 100% clean yet, as there's common
parts that are still protocol specific. We'll clean that up
in the next commit.
2014-03-30 22:55:03 -04:00
Jasper St. Pierre
1e2bdcc3c5 idle-monitor: Move reset_idletime handling to events.c
It's not specific to the Wayland protocol at all, and it's not really
a Wayland compositor thing. This should eventually be in the native
backend.
2014-03-30 22:55:02 -04:00
Jasper St. Pierre
490e1c8c3b idle-monitor: Split the DBus implementation to a separate file 2014-03-30 22:55:02 -04:00
Jasper St. Pierre
9a751a95e3 idle-monitor: Rearrange code to make it a cleaner split
We're going to push this to be subclasses soon.
2014-03-30 22:55:02 -04:00
Jasper St. Pierre
afce448281 Kill meta_ui_add_event_func / remove_event_func
The reason we don't simply use gdk_window_add_filter directly is
because of some twisted idea that any GDK symbol being used from
core/ is a layer violation. While we certainly want to keep any
serious GDK code out of ui/, event handling is quite important
to have in core/, so simply use a GDK event filter directly.
2014-03-30 22:55:01 -04:00
Jasper St. Pierre
b2405b701a Move monitor manager headers to their own files
Instead of having them in monitor-private.h.

This way, it's easier to move our own backend when the chance arises.
2014-03-30 22:54:52 -04:00
Jasper St. Pierre
390c028da7 Rename the monitor backend filenames
To match the "meta-*" new-style naming.
2014-03-30 20:21:39 -04:00
Jasper St. Pierre
0f9b29b140 display: Don't double-free the screen
We already free the screen once in meta_display_close.

This fixes a crash when trying to restart mutter.
2014-03-28 13:58:50 -04:00
Jasper St. Pierre
b367965f6c window: Track known_to_compositor and visible_to_compositor separately
Really, visible_to_compositor means that the window is shown, e.g.
not minimized. We need to be using a boolean tracking whether we've
called meta_compositor_add_window / meta_compositor_remove_window.

This fixes a jump during window placement when a window appears.
2014-03-28 13:52:59 -04:00
Jasper St. Pierre
ed9dbf6aa2 window: Ensure that visible_to_compositor is set when unmanaging
visible_to_compositor should always be in sync with show_window /
hide_window calls, even when unmananging.

This fixes a crash where we call sync_window_state when the window
is unmanaging, since we use visible_to_compositor to determine whether
the compositor will crash.

This is actually wrong; we should be using the knowledge about
whether we have called add_window / remove_window. We'll introduce
this with a new boolean next time.
2014-03-28 13:51:34 -04:00
Jasper St. Pierre
e10fd19d24 events: Make sure to check the event window of the MapNotify
This was lost in a rebase when killing off zaphod mode.
2014-03-28 13:46:46 -04:00
Jasper St. Pierre
3f70bdd331 display: Revert API break for get_tab_list
gnome-shell apparently uses this, and we shouldn't break it.
2014-03-27 12:48:05 -04:00
Jasper St. Pierre
cd905a34fb compositor: Kill off MetaCompScreen
Compositors haven't been able to manage more than one screen for
quite a while. Merge MetaCompScreen into MetaCompositor, and update
the API to match.

We still keep MetaScreen in the public compositor API for compatibility
purposes.
2014-03-26 12:04:48 -04:00
Jasper St. Pierre
47aa583625 display: Kill off grab_screen
Just like active_screen, the screen can always be inferred
from the MetaDisplay, so there's no point in keeping it around.
2014-03-26 12:04:48 -04:00
Jasper St. Pierre
d7519f4ebc Remove any possibility for zaphod mode
We previously separated out MetaDisplay and MetaScreen. mutter
would only manage one screen, but we still kept a list of screens
for simplicity.

With Wayland support, we no longer care about the ability to
manage more than one screen at a time. Remove this by killing
the list of screens, in favor of having just one MetaScreen
in MetaDisplay.

We also kill off active_screen at the same time, since it's
not necessary anymore.

A future cleanup should merge MetaDisplay and MetaScreen. To avoid
breaking API, we should probably keep MetaScreen around as a dummy
type.
2014-03-26 12:04:48 -04:00
Florian Müllner
71be7e8493 display: Fix compiler warning
Don't leave a variable uninitialized in case we don't find a matching
surface.
2014-03-25 16:32:22 +01:00
Jasper St. Pierre
42491f7724 window: Actually interpret the FRAME_SHAPE_CHANGED result
When I refactored this out into a vfunc, I forgot to change the
code that interprets the result flags to actually respect the
new FRAME_SHAPE_CHANGED result flag.

Since we weren't ever clearing the frame bounds, this meant that
the "shadow clip" wasn't ever updated as a result. Since right now
all Wayland surfaces are considered ARGB32, we always clip shadows
under frames, and thus shadows had this weird "punch-out" from the
first frame shape.
2014-03-20 18:03:35 -04:00
Jasper St. Pierre
9696e785da screen: Remove flash_window
It's unused as well
2014-03-20 16:48:15 -04:00
Jasper St. Pierre
0de83ebfb5 display: Remove get_leader_window
It's unused.
2014-03-20 16:46:21 -04:00
Jasper St. Pierre
337db2a660 window: Kill off the rest of colormaps
I removed the XInstallColormap / XUninstallColormap but forgot
to remove the fields in MetaWindow and the code to set them.
2014-03-20 16:27:22 -04:00
Jasper St. Pierre
054c307353 window: Remove support for colormaps
While the ICCCM mandates the use of this, it's not necessary under
a composited environment from my understanding, and it's a flat
out no-op under XWayland.

Looking at the other rootless servers like Xwin/Xquartz, it seems
that they contain code for colormap emulation, but they're actually
never used -- a bug prevents the code from ever being called. Given
that it's been this way since 2003, I'm going to hazard a guess that
not many apps using colormaps. Kill them off.
2014-03-20 16:25:09 -04:00
Jasper St. Pierre
852589897e Move send_icccm_message to window-x11 2014-03-20 16:22:15 -04:00
Jasper St. Pierre
46b4d6c0f0 Move request_take_focus to window-x11
This will let us kill off send_icccm_message
2014-03-20 16:06:24 -04:00
Jasper St. Pierre
ab2224686a events: Clean up trailing whitespace 2014-03-20 15:54:16 -04:00
Jasper St. Pierre
24b08d1a36 Move event handling to a new file
display.c is getting a bit crowded. Move most of the handling
out to another file, events.c.

The long-term goal is to have generic event handling here, with
backend-specific handling for the types of windows and such.
2014-03-20 15:46:32 -04:00
Jasper St. Pierre
0808adefaf Move focus to be a vfunc 2014-03-20 15:20:15 -04:00
Jasper St. Pierre
14f424cd02 Move ping to be a vfunc 2014-03-20 15:20:15 -04:00
Jasper St. Pierre
9debd2fb0d Move delete / kill to be a vfunc 2014-03-20 15:07:44 -04:00
Rui Matos
76dc0ca681 wayland: Exempt CLICKING grab ops when syncing wayland input focus
If we have a CLICKING grab op we still need to send events to xwayland
so that we get them back for gtk+ to process thus we can't steer
wayland input focus away from it.

https://bugzilla.gnome.org/show_bug.cgi?id=726123
2014-03-20 17:08:53 +01:00
Rui Matos
1b29113150 wayland: Set/unset wayland focus on mutter grab/ungrab operations
This ensures that we send the proper leave and enter events to wayland
clients.

Particularly, this solves a bug in SSD xwayland windows where clicking
and dragging on the title bar to move the window only works on the odd
turn (unless the pointer moves away from the title bar between
tries). This happens because xwayland gets a button press but doesn't
see the release so when it gets the next button press it discards it
because its pointer button tracking logic says that the button is
already pressed. Sending the proper wayland pointer leave event fixes
it since wayland clients must forget about button state at that point.

https://bugzilla.gnome.org/show_bug.cgi?id=726123
2014-03-20 17:08:53 +01:00
Jasper St. Pierre
15c59f9919 keybindings: Split out check for filter_keybinding
This is a small code cleanup for clarity.
2014-03-20 11:03:54 -04:00
Jasper St. Pierre
a53e094fcd window: Move move_resize_internal logic to protocol-specific directories 2014-03-20 11:02:50 -04:00
Jasper St. Pierre
a377a1a110 window: Move client-type-specific managing / unmanaging to a vfunc 2014-03-20 10:51:32 -04:00
Jasper St. Pierre
74a1e00e30 window: MetaWindow is now abstract 2014-03-20 10:50:27 -04:00
Jasper St. Pierre
1c41f71eef window: Add a type for Wayland windows 2014-03-20 10:50:27 -04:00
Jasper St. Pierre
63350c52cc window: Remove code for static gravity resizes
It was never turned on for all the years it's been there.
2014-03-20 10:50:27 -04:00
Jasper St. Pierre
a1427c7130 Revert "Move MetaGroup to be X11-specific"
This reverts commit f940292cfe.

Turns out MetaGroup was public API and was used by gnome-shell.
Ugh.
2014-03-19 09:12:48 -04:00
Jasper St. Pierre
5fa5ace5e6 Move session to x11/
XSMP code is X11-specific, of course.
2014-03-18 22:04:36 -04:00
Jasper St. Pierre
044c06bff3 Don't include wayland/ by default either 2014-03-18 22:04:36 -04:00
Jasper St. Pierre
a3ccc4fd1c Remove x11/ directory from default include path 2014-03-18 22:04:36 -04:00
Jasper St. Pierre
0a20f7458c window: Remove support for _NET_WM_ICON_NAME
We don't seem to use it anywhere.
2014-03-18 22:04:36 -04:00
Jasper St. Pierre
9c94f8ae47 Move testasyncgetprop.c to x11/ 2014-03-18 22:04:27 -04:00
Jasper St. Pierre
f940292cfe Move MetaGroup to be X11-specific 2014-03-18 21:23:36 -04:00
Jasper St. Pierre
48a36356dd window: Make window->desc a bit clearer
And remove the hack for the "broken GNU libc". It works fine on
my system here.
2014-03-18 21:23:34 -04:00
Jasper St. Pierre
f05983be42 window: Move type_atom to window-x11 2014-03-18 21:15:49 -04:00
Jasper St. Pierre
dfcefd3315 Remove meta_core_increment_event_serial
It's unused.
2014-03-18 21:12:37 -04:00
Jasper St. Pierre
3fe755e684 display: Fix a typo 2014-03-18 21:12:37 -04:00
Jasper St. Pierre
43a409dec4 window: Don't sync window geometry when we haven't shown it yet 2014-03-18 18:55:32 -04:00
Jasper St. Pierre
8b2b65246a Assume the compositor always exists
At one point, it was supported to run mutter without a compositor,
but we don't allow that any longer. A lot of code already assumes
display->compositor exists and doesn't check for a NULL pointer,
so just kill the rest of the checks.
2014-03-18 18:25:32 -04:00
Jasper St. Pierre
da48b18188 window: Fix build
A bad rebase on top of some other GObject cleanups I had made
this go sour.
2014-03-18 16:45:53 -04:00
Jasper St. Pierre
a5f1790828 window: Rename wm_hints_urgent to urgent
The flag and setter is now decoupled from the WM_HINTS state.
2014-03-18 15:44:11 -04:00
Jasper St. Pierre
6efcf2526d window: Move urgency to a setter 2014-03-18 15:44:11 -04:00
Jasper St. Pierre
d6a27195d3 Move more fields to MetaWindowX11 2014-03-18 15:44:11 -04:00
Jasper St. Pierre
8f151842fb Start moving X11 implementation to its own subdirectory
This is specifically about managing X11 windows, not necessarily
running as an X11 compositor. By that I mean that this code is
still used for XWayland windows, and event handling is still and
modesetting / monitor management is still in core/.

This is also a fairly conservative move. We don't move anything
like screen.c or bell.c in here, even though those are really
only for X11 clients.
2014-03-18 15:44:11 -04:00
Jasper St. Pierre
6f7023bc6b Start splitting the X11-specific stuff of MetaWindow out into a subclass
This is fairly simple and basic for now, with just skip_taskbar /
skip_pager, but eventually a lot of "WM policy" like this, including
move-resize, will be in subclasses for each individual surface.
2014-03-18 15:44:11 -04:00
Jasper St. Pierre
63b158e4da window: Split out recalc of skip_taskbar / skip_pager
This will be our first attempt for the MetaWindowX11Private
2014-03-18 15:44:11 -04:00
Jasper St. Pierre
3de58189c0 window: Remove an unused bit 2014-03-18 13:18:52 -04:00
Jasper St. Pierre
5270c469a3 window: Remove meta_window_set_gravity as "public" API 2014-03-18 11:24:24 -04:00
Jasper St. Pierre
7504f16e59 Replace wm_state_modal usage with META_WINDOW_TYPE_DIALOG 2014-03-18 11:24:24 -04:00
Jasper St. Pierre
cdb7947dd1 window: Remove meta_window_is_modal
It relies on EWMH concepts. Wayland simply has a MODAL_DIALOG type.
2014-03-18 11:24:24 -04:00
Jasper St. Pierre
cdfc6f5b53 window: Remove vfunc slots for signals
These aren't used currently, and we're going to be adding
more vfuncs.
2014-03-18 11:24:24 -04:00
Jasper St. Pierre
fcb2ab41b2 window: Remove another bogus comment
It's not referring to anything!
2014-03-18 11:24:16 -04:00
Jasper St. Pierre
f5bd7c5f50 window: Remove bogus comment
These fields haven't been around for quite some time.
2014-03-18 11:24:16 -04:00
Jasper St. Pierre
cb549154aa window: Move meta_window_configure_notify to window-x11 2014-03-18 11:24:16 -04:00
Jasper St. Pierre
ada9610e30 Start hacking out use of xtransient_for
It won't work under Wayland.
2014-03-18 10:25:54 -04:00
Jasper St. Pierre
f11bf44525 stack: Flatten and simplify the default focus window logic 2014-03-18 10:25:54 -04:00