1
0
Fork 0
Commit graph

552 commits

Author SHA1 Message Date
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
Jasper St. Pierre
1762436775 display: Remove the screen from set_grab_op_cursor 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
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
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
813206393a events: Handle move/resize grab ops as a first special case 2014-04-21 12:14:29 -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
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
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
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
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
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
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
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
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
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
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
0808adefaf Move focus to be a vfunc 2014-03-20 15:20:15 -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
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
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
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
cb549154aa window: Move meta_window_configure_notify to window-x11 2014-03-18 11:24:16 -04:00
Jasper St. Pierre
1f15c85c00 window: Make window_is_terminal private 2014-03-18 10:25:54 -04:00
Jasper St. Pierre
8b4c5459c0 window: Remove transient_for_as_xid
It's unused, and it exposes an X11-specific property to API.
2014-03-18 10:07:07 -04:00
Jasper St. Pierre
3c6dd5bf6d window: Export a bunch of state flags as accessor methods
This is necessary to reimplement window menus in gnome-shell.
2014-03-15 09:49:56 -04:00
Jasper St. Pierre
0f85986340 Add a META_MAXIMIZE_BOTH
Which has the value of META_MAXIMIZE_VERTICAL |
META_MAXIMIZE_HORIZONTAL.

This is an obvious code cleanup.
2014-03-15 09:49:56 -04:00
Jasper St. Pierre
a9d8107c3d window: Replace meta_window_type_changed with meta_window_set_type
Which does the equality checking for us.
2014-03-13 17:14:28 -04:00