Commit Graph

6985 Commits

Author SHA1 Message Date
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