1
0
Fork 0
Commit graph

32 commits

Author SHA1 Message Date
Marek Chalupa
c14382181f wayland window: update buffer_rect when moving
Update both - rect and buffer_rect positions when moving wayland window

https://bugzilla.gnome.org/show_bug.cgi?id=731237
2014-06-26 10:50:29 -04:00
Jasper St. Pierre
b0b8f37240 window: Save the buffer_rect internally
Rather than calculate it speculatively with the current properties
which may be too new or too out of date, make sure it always fits
with the proper definition. We update it when we update the toplevel
window for X11, and when a Wayland surface is committed with a newly
attached buffer.
2014-06-17 11:15:32 -04:00
Jasper St. Pierre
a3747725ed window-wayland: Don't use meta_window_get_position 2014-05-22 15:47:30 -04: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
1a3aa75385 window: Move meta_window_wayland_new to window-wayland.c 2014-05-20 15:59:17 -04:00
Jasper St. Pierre
41880778b5 window-wayland: Change the state on grab op transitions
This could affect the RESIZING state.
2014-05-20 15:59:17 -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
33cb7f4a2c wayland: Send a correct width / height for state changes
If we send out a configure notify for a window and then have some
other kind of state change, we need to make sure that we continue
to send out that new size, rather than the last size the client
sent us a buffer for.

In particular, a client might give us a 250x250 buffer and then
immediately request fullscreen. We send out a configure for the
monitor size and a state that tells it it's full-screen, but then
it takes focus, and since the client hasn't sent us a buffer for
the new size, we tell it it's fullscreen at 250x250.

Fix this.
2014-05-12 18:25:24 -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
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
57bb297450 window-wayland: Fix interactive resizing from the top/left once more
Ugh. So in the fullscreen case, we need to make sure to specify that
it's a MOVE_ACTION so that we move to the saved position, but we
can't do that in the resizing case since we need to use the resized
rectangle.

The flags are really hurting us here. Perhaps we should make it the
client's responsibility to specify a complete rectangle which we
could resize to; then the weird-o logic would be self-contained in
each front-end.

I'm not convinced this covers all cases, especially when we could have
a dangling weird state pointer, but it fixes our existing two testcases.
2014-05-01 18:59:17 -04:00
Jasper St. Pierre
b773898a60 window-wayland: Fix resizing from the top/left once more
Restoring the position in our move_resize_internal implementation
is too late. We need to do it at ack-time, before we hand off the
new position to the constraints code.
2014-04-28 18:22:55 -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
ce5c029509 window-wayland: Make sure to save where the position for server-initiated resizes
For the server-initiated resize case, like unmaximize or some forms
of tiling, we dropped the x/y of the server-assigned rectangle on the
floor, which meant the surface didn't move to where it needed to be in
that case. Now, save it internally, and combine it with the dx/dy passed
in during attaches to figure out where we actually need to be.

Make sure to only use it for when we send out a configure notify. We
should use the passed in rectangle for other scenarios, like a
client-initiated resize.

This fixes incorrect surface placement after unmaximization.
2014-04-28 16:23:38 -04:00
Jasper St. Pierre
647743aa5f Revert "window-wayland: Don't enter the only-moving path for Wayland
resizes"

We're going to use the old code structure now.

This reverts commit 23ae11043f.
2014-04-28 16:23:38 -04:00
Jasper St. Pierre
e94f169d4e Revert "window-wayland: Make sure to save where the position for server-initiated resizes"
This is wrong for client-initiated resizes now.

This reverts commit e6b0525c70.
2014-04-28 16:23:38 -04:00
Jasper St. Pierre
e6b0525c70 window-wayland: Make sure to save where the position for server-initiated resizes
For the server-initiated resize case, like unmaximize or some forms
of tiling, we dropped the x/y of the server-assigned rectangle on the
floor, which meant the surface didn't move to where it needed to be in
that case. Now, save it internally, and combine it with the dx/dy passed
in during attaches to figure out where we actually need to be.

This fixes incorrect surface placement after unmaximization.
2014-04-28 16:11:10 -04:00
Jasper St. Pierre
23ae11043f window-wayland: Don't enter the only-moving path for Wayland resizes
We'll be adding additional code here for "correct" moving soon, so
we need to make sure not to do it for Wayland resizes.
2014-04-28 16:11:09 -04:00
Jasper St. Pierre
78657dafca window-wayland: Clean up a bit 2014-04-28 16:11:09 -04:00
Jasper St. Pierre
0f47eae33a window-wayland: Split an if statement in two 2014-04-28 16:11:09 -04:00
Jasper St. Pierre
eb1c9175f9 wayland: Move the RESULT_RESIZED code to the proper place
We need to set this when we update window->rect, not when we simply
send out a configure event.
2014-04-16 16:31:45 -04:00
Jasper St. Pierre
f25243e121 wayland: Don't move the window when we're simply sending out a configure
If we're sending out a configure event, we can't immediately move the
window; we need to instead wait to apply the new position when the
client sends a new buffer.
2014-04-16 16:31:45 -04: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
260b6d02f2 wayland: Simplify the move/resize code
The old protocol is out of date and broken for resizing at the
top/left. This is still as broken, but a lot simpler.
2014-04-16 16:31:45 -04:00
Jasper St. Pierre
ef65848d11 window-wayland: Implement kill 2014-03-25 12:05:21 -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
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
1c41f71eef window: Add a type for Wayland windows 2014-03-20 10:50:27 -04:00