1
0
Fork 0
Commit graph

512 commits

Author SHA1 Message Date
Jasper St. Pierre
cbffbb0be0 window: Rename the requested_rect to the unconstrained_rect
The requested_rect is a strange name for it, because it's not actually
the rect that the user or client requested all the time: in the case of
a simple move or a simple resize, we calculate some of the fields
ourselves.

To the MetaWindow subclass implementations, it just means "the rect
before we constrained it", so just use the name unconstrained_rect.
This also makes it match the name of the MetaWindow field.
2014-05-22 15:39:10 -04:00
Jasper St. Pierre
9df5b17940 window: Allow passing garbage window sizes for move-only actions
We'll just fix them up in meta_window_move_resize_internal.
2014-05-22 15:39:10 -04:00
Jasper St. Pierre
6513cbb470 Add back coordinates to the window menu
It looks weird to have Alt+Space pop up under the cursor instead
of the top-left corner of the window, and the Wayland request will
pass through the coordinates as well.

Add it to the compositor interface, and extend the
_GTK_SHOW_WINDOW_MENU ClientMessage to support it as well.
2014-05-22 10:50:57 -04:00
Florian Müllner
f38c1f6ab4 window: Fix delayed mouse mode on X
On X, basing the check whether the pointer is on the window on
Clutter events does not work, as the relevant events are handled
by GDK instead.
So add an X-specific window_has_pointer() implementation to also
fix mouse mode when running as X compositor.

https://bugzilla.gnome.org/show_bug.cgi?id=730541
2014-05-21 22:56:14 +02:00
Florian Müllner
f159611fab window: Fix delayed mouse mode
Using clutter_actor_has_pointer() to test whether the pointer is
on the window makes for clean and nice-looking code, but does not
work in practice - ClutterActor:has-pointer is not recursive, so
we miss when the pointer is on the associated surface actor rather
than the actor itself.
Instead, check whether the window actor contains the core pointer's
pointer actor, which actually works.

https://bugzilla.gnome.org/show_bug.cgi?id=730541
2014-05-21 22:56:14 +02:00
Jasper St. Pierre
f1a7231ac2 window: Remove another comment reference to StaticGravity 2014-05-21 13:20:10 -04:00
Jasper St. Pierre
21991a7edb window: Remove some overcomplicated uses of meta_window_move_resize
Replace them with meta_window_move_frame, since that's all we need
to do.
2014-05-21 13:15:49 -04:00
Jasper St. Pierre
6c37f6e601 window: Remove meta_window_resize
It's unused, and it's a poor API. resize_with_gravity and resize_frame
are better.
2014-05-21 12:16:56 -04:00
Jasper St. Pierre
92e9f3d467 window: Reindent slightly 2014-05-21 12:16:56 -04:00
Jasper St. Pierre
e215c07439 window: Make border_width private to X11 2014-05-20 15:59:17 -04:00
Jasper St. Pierre
1a3aa75385 window: Move meta_window_wayland_new to window-wayland.c 2014-05-20 15:59:17 -04:00
Jasper St. Pierre
d02505852d window: Move _NET_WM_DESKTOP setting to window-x11 2014-05-20 15:59:16 -04:00
Jasper St. Pierre
56906a29e0 window: Make propagate_focus_appearance internal to MetaWindow
It's an internal helper function. The public interface is
meta_window_activate or meta_window_focus.
2014-05-20 15:59:15 -04:00
Jasper St. Pierre
2c0ad5bef7 window: Replace the user_rect with the unconstrained_rect
Realistically, the user rect contains the unconstrained window
rectangle coordinates that we want to be displaying, in case
something in the constraints change.

Rename it to the "unconstrained_rect", and change the code to always
save it, regardless of current state.

When metacity was originally being built, the purpose of the user
rect was a lot less clear. The code only saved it on user actions,
with various other calls to save_user_window_placement() and a force
mechanism sprinkled in to avoid windows being snapped back to odd
places when constraints changed.

This could lead to odd bugs. For instance, if the user uses some
extension which automatically tiles windows and didn't pass
user_action=TRUE, and then the struts changed, the window would be
placed back at the last place a user moved it to, rather than where
the window was tiled to.

The META_IS_USER_ACTION flag is still used in the constraints code
to determine whether we should allow shoving windows offscreen, so
we can't remove it completely, but we should think about splitting
out the constrainment policies it commands for a bit more
fine-grained control.

https://bugzilla.gnome.org/show_bug.cgi?id=726714
2014-05-20 15:59:14 -04:00
Jasper St. Pierre
550f1989ff window: Complete moving enter/leave handling here 2014-05-19 15:03:05 -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
7732447abc wayland: Update to latest xdg-shell protocol 2014-05-12 18:25:23 -04:00
Jasper St. Pierre
c49c37999c wayland: Move appears-focused changed handling to window-wayland 2014-05-12 18:25:19 -04:00
Jasper St. Pierre
7a109a18af events: Move window button handling to window.c
Look at how clean GCD is now!!!
2014-05-08 15:34:27 -04:00
Jasper St. Pierre
bca210db45 Revert "Update to latest xdg-shell protocol"
This reverts commit fd5c14550a.

Again, pushed by accident, whoops.
2014-05-05 19:09:07 -04:00
Jasper St. Pierre
fd5c14550a Update to latest xdg-shell protocol 2014-05-05 14:15:03 -04:00
Jasper St. Pierre
a5cca5296c window: Make sure not to eat any events that end grab ops
We need to send the button press / button release that ended a grab
op to Wayland clients so their tracking don't get confused.
2014-05-05 14:15:03 -04:00
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
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
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
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
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
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
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
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
14f839c53c window: Only grab/ungrab buttons/keys on X11 windows 2014-04-24 16:26:21 -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
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
eed03d38b0 Update to latest xdg-shell protocol 2014-04-23 14:23:13 -04:00