1
0
Fork 0
Commit graph

529 commits

Author SHA1 Message Date
Jasper St. Pierre
ad60ea9e0e display: Use meta_window_has_pointer instead of XQueryPointer 2014-06-12 17:46:23 -04:00
Florian Müllner
b64548ee1f Pass button_rect when opening window menu from button
When opening the window menu without an associated control - e.g.
by right-clicking the titlebar or by keyboard - using coordinates
for the menu position is appropriate. However when the menu is
associated with a window button, the expected behavior in the
shell can be implemented much easier with the full button geometry:
the menu will point to the center of the button's bottom edge
rather than align to the left/right side of the titlebar as it
does now, and the clickable area where a release event does not
dismiss the menu will match the actual clickable area in mutter.

So add an additional show_window_menu_for_rect() function and
use it when opening the menu from a button.

https://bugzilla.gnome.org/show_bug.cgi?id=731058
2014-06-02 23:49:48 +02:00
Jasper St. Pierre
53425fa721 window: Make sure not to respond to input events on OR windows
This can happen since we select for events on the root window, and
clients themselves might not select for input, meaning the X server
will bubble up. Just do nothing and ignore the event in this case.

This should hopefully fix some of the

Window manager warning: Log level 8: meta_window_raise: assertion '!window->override_redirect' failed
Window manager warning: Log level 8: meta_window_focus: assertion '!window->override_redirect' failed

spam that people have been seeing.
2014-06-02 15:51:41 -04:00
Jasper St. Pierre
b32c837df9 window: Fix placement not actually placing windows
Since we often call meta_window_move_resize_now immediately after
mapping a window, we need to make sure that the placed coordinates
are saved in the unconstrained_rect. Ideally, placement positions
wouldn't be part of the constraints system, but instead are just
done inside meta_window_move_resize_internal as part of a special
path.

We're still working out the kinks of one large-scale refactor, so
it's best not to do another one while the first is going on. This
would be a great future cleanup, though: untangling constraints
and placement, alongside the force_placement state machine and
friends.
2014-05-29 14:09:57 -04: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
1fe5b3e7d5 window: Construct the frame before the initial move_resize
This ensures sure that the initial ConfigureRequest we make is
correct.
2014-05-28 11:47:14 -04: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
626516d12e window: Remove meta_window_move as well
Move to meta_window_move_frame everywhere...
2014-05-27 15:44:33 -04:00
Jasper St. Pierre
1c94df2553 window: Replace meta_window_resize_with_gravity with a frame-rect variant
More low-hanging fruit for our window geometry cleanups...
2014-05-27 15:44:33 -04:00
Jasper St. Pierre
266166a2d6 window: Make meta_window_unmaximize_with_gravity internal 2014-05-27 15:15:57 -04:00
Jasper St. Pierre
3a0af0faae window: Add a meta_window_get_titlebar_rect 2014-05-27 15:15:56 -04:00
Jasper St. Pierre
0890eaa3fe window: Rename get_geometry to get_session_geometry 2014-05-27 15:15:56 -04:00
Jasper St. Pierre
d4058d947b window: Remove meta_window_get_rect
It's a bad API that returns weird results you wouldn't expect.
2014-05-27 15:15:41 -04:00
Jasper St. Pierre
b704659899 backend: Add an XIWarpPointer wrapper
This makes Alt+F7 / Alt+F8 work respectively under X11 nested mode.
For the native backend implementation, we'll need a special Clutter
function, so don't implement that for now.
2014-05-27 14:28:35 -04:00
Florian Müllner
0a9187a6e9 window: Add accessor method for gtk_theme_variant
This is useful information for UI associated with a window, so add
a corresponding method.

https://bugzilla.gnome.org/show_bug.cgi?id=730752
2014-05-27 19:40:06 +02:00
Florian Müllner
31db32e826 Actually implement opening the app menu
The last commit added support for the "appmenu" button in decorations,
but didn't actually implement it. Add a new MetaWindowMenuType parameter
to the show_window_menu () functions and use it to ask the compositor
to display the app menu when the new button is activated.

https://bugzilla.gnome.org/show_bug.cgi?id=730752
2014-05-27 19:40:06 +02:00
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