1
0
Fork 0
Commit graph

658 commits

Author SHA1 Message Date
Rui Matos
0484ef142d MetaWindow: Change icon properties to be of pointer type
Follow up to commit af7f51b992 .

https://bugzilla.gnome.org/show_bug.cgi?id=742824
2015-01-13 16:01:13 +01:00
Jasper St. Pierre
90111c03a1 Only poke the frames UI code from inside frame.c
Add frame.c wrappers for the missing calls, then adapt.
2014-12-31 22:35:29 -08:00
Jasper St. Pierre
af7f51b992 x11: Change the iconcache / window icons to being cairo surfaces
This simplifies the drawing codepath and makes us able to delete
a bunch of GdkPixbuf manipulation.
2014-12-31 21:11:21 -08:00
Jasper St. Pierre
f3d30d897f window: Refactor the default image lookup 2014-12-31 20:48:32 -08:00
Jasper St. Pierre
b24cd5ae08 window: Force state changes on maximized / fullscreen 2014-12-15 13:52:40 -08:00
Jasper St. Pierre
c782078e00 Rename MetaMoveResizeFlags items to fit with the theme
Use a proper prefix, even if more wordy, instead of META_IS.
2014-12-15 13:30:39 -08:00
Jasper St. Pierre
286a6ada5a window: Make sure size hints are applied in client rect on unfullscreen 2014-11-12 17:53:44 -08:00
Jasper St. Pierre
b3544f8ec1 window: Placate new gcc
It thinks remaining can be used uninitialized. It's wrong, but let's
help it out by initializing the variable.
2014-10-23 16:04:42 -07:00
Carlos Garnacho
8819d9ce66 core: end-of-grab button releases must be consumed by the window
Returning FALSE here gets the button release event propagated to the
client on wayland, which is unexpected after xdg_surface.move/resize()
have been called.

https://bugzilla.gnome.org/show_bug.cgi?id=738888
2014-10-23 16:53:44 +02:00
Florian Müllner
5664c703b7 screen: Always consider monitors with fullscreen windows "in-fullscreen"
Fullscreen windows look weird when they are overlapped by system chrome,
which currently happens when another window is stacked above. We used to
auto-minimize fullscreen windows in that case, which proved to be both
unreliable and unpopular. So instead, keep the system chrome hidden even
when the fullscreen window is not stacked at the top.

https://bugzilla.gnome.org/show_bug.cgi?id=693991
2014-10-14 18:42:38 +02:00
Jasper St. Pierre
166668adc4 window: Remove duplicate case value 2014-10-06 19:39:38 -07:00
Jasper St. Pierre
ec797b055d window: Mark all override-redirect window types as appears-focused 2014-10-06 19:30:12 -07:00
Jasper St. Pierre
993bec37d7 window: Ensure that popup window types propagate their focus appearance
In Wayland, popup window types are not override-redirect, and thus can
steal window focus away from their parent window when clicked on.

This means that we need to make sure their appearance is properly
propagated to the parent windows so the parent windows don't lose their
focus while they're propagated.
2014-10-06 17:01:08 -07:00
Florian Müllner
482a97466d window: Fix typo 2014-09-27 07:41:10 +02:00
Florian Müllner
4e14bb9df3 window: Fix corner case in set_demands_attention()
We only grant requests to set the demands-attention hint if the window
is at least partially obscured; so for non-minimized windows on the
active workspace, we check if any other window on the same workspace
that is higher in the stack overlaps.
However in the case of a sticky window, window->workspace is NULL, so
we end up considering any non-sticky window on a different workspace.

At this point we have already established that the window is showing
on the active workspace, so use that to filter for windows that may
overlap.
2014-09-27 06:43:16 +02:00
Florian Müllner
df90545258 window: Fix crash when mapping sticky window
Since the introduction of set_workspace_state(), window->workspace
will always be NULL when on_all_workspaces is set - passing that
to a workspace function that does not validate its input will then
result in a crash.
Use the get_workspace() function instead, which will always return
a valid workspace.
2014-09-27 06:41:35 +02:00
Florian Müllner
d06b39d13c window: Fix another case of uninitialized workspace state
Since commit 2eec11b445, windows without a __NET_WM_DESKTOP property
that should be on all workspaces are not added to the active workspace;
this is correct, however not adding them to any workspace is not ...
2014-09-26 11:48:11 +01:00
Florian Müllner
1e1ca47ec1 window: Always set workspace state while constructing
set_workspace_state () returns early when the desired sticky state
and workspace match the current property values, assuming that the
corresponding MRU lists are already correct in that case.
However that might not be the case when we are setting the initial
state, so don't take the shortcut in that case.

https://bugzilla.gnome.org/show_bug.cgi?id=737178
2014-09-25 15:16:09 +01:00
Florian Müllner
2eec11b445 window: Be more careful when setting initial workspace state
A window may either be sticky because it has been requested as such,
or because it is placed on a non-primary monitor (and the corresponding
preference is set). While we do take the latter into account, we
currently override the sticky state later during initialization;
be a bit more careful there to get the initial state right.

https://bugzilla.gnome.org/show_bug.cgi?id=737178
2014-09-25 15:16:09 +01:00
Florian Müllner
73ca0efaeb window: Fix titlebar_is_onscreen() test
The titlebar rect is in window coordinates, while screen regions are
obviously not. Fix by translating into screen coordinates before
testing for overlaps.

https://bugzilla.gnome.org/show_bug.cgi?id=736915
2014-09-22 20:12:08 +02:00
Jasper St. Pierre
0cde7879d6 window: Move set_custom_frame_extents to be X11-only
Wayland doesn't use custom frame extents anymore -- it uses a full
geometry description.
2014-09-19 17:35:38 -06:00
Owen W. Taylor
73573a85de Replace MetaStackWindow with a 64-bit "stack ID"
Putting X windows and pointers to MetaWindows into a union had a number of
problems:

 - It caused awkward initialization and conditionalization
 - There was no way to refer to Wayland windows (represented by
   MetaWindow *) in the past, which is necessary for the MetaStackTracker
   algorithms
 - We never even cleaned up old MetaStackWindow so there could be
   records in MetaStackWindow pointing to freed MetaWindow.

Replace MetaStackWindow with a 64-bit "stack ID" which is:

 - The XID for X Windows
 - a "window stamp" for Wayland windows - window stamps are assigned
   for all MetaWindow and are unique across the life of the process.

https://bugzilla.gnome.org/show_bug.cgi?id=736559
2014-09-12 13:42:56 -04:00
Jasper St. Pierre
b3b9d9e161 stack: Never focus unmanaging windows
We can enter weird states where get_default_window is called during
window unmanagement, before the window has been fully removed from
the stack. Make sure these windows are *never* returned from
get_default_window, as focusing them can cause an assertion fail,
or worse.
2014-09-04 13:53:06 -07:00
Jasper St. Pierre
604d2155ba window: Don't map the client window before placing it
A lot of applications assume that the window is fully positioned when it
gets the MapNotify, especially simple applications. Make sure that the
window is only mapped through the calc_showing logic.
2014-09-01 11:46:12 -07:00
Jasper St. Pierre
e7727d698f window: Make calc_showing private 2014-09-01 11:42:21 -07:00
Jasper St. Pierre
34979c3fe8 window: Don't try to map / unmap OR windows by ourselves
This is bad behavior, and can also cause us to get in an infinite loop
if an OR window is mapped and unmapped in quick succession. This
sequence causes a MapNotify followed by an UnmapNotify, and when
processing the events, we'll call XMapWindow, XUnmapWindow, which will
put another set of MapNotify, UnmapNotify events in our queue, which we
then process by calling XMapWindow, XUnmapWindow, and so it goes
forever, or at least some scheduler uncorks us by making us call
XMapWindow when the window is already mapped, or XUnmapWindow when the
window is already unmapped.

We can stop this madness by simply making sure never to call neither
XMapWindow or XUnmapWindow on OR windows, which is the correct thing to
do anyway.
2014-08-19 16:04:40 -04:00
Jasper St. Pierre
933d05a565 window: Fix the north/south cursor position when keyboard resizing
We got these backwards...
2014-08-19 15:10:55 -04:00
Jasper St. Pierre
6fd1de226b window: Add a hack to correct dragging from the top panel in gnome-shell
In gnome-shell, we have a feature where the user can unmaximize windows
by dragging them from the panel above the window. With accurate
anchoring, this looks really weird as the cursor is now "detached" from
the window. Detect this case and put the cursor in the middle of the
window titlebar instead.
2014-08-19 13:59:39 -04:00
Jasper St. Pierre
ac099343da window: Increase the height of CSD titlebars
This seems to be more accurate with what we currently see in
GNOME. Without having the app expose this information to us, it might be
a better idea to use the default frame style for this information instead.
2014-08-19 13:59:34 -04:00
Jasper St. Pierre
bce5f3f108 window: Fix cursor anchoring issues when drag-unmaximizing windows
The cursor was anchored wrongly when trying to unmaximize windows from
dragging them from the top of the screen because of a few think-o's and
some code that forgot to be updated when we moved to the frame rect
coordinate system.

The cursor is still offset for windows that start dragging from the top
panel. This is technically correct, but looks wrong. We'll fix this in
the next commit.
2014-08-19 13:48:00 -04:00
Jasper St. Pierre
527c53a2a0 workspace: Rewrite workspace management code
The existing workspace management code is quite hairy, with plenty of
logic inline in all of window.c, workspace.c, and screen.c, making it
hard to understand or make changes to, since you might forget to change
several of the other places the code was around.

Rewrite the internal workspace management logic so that it's
centralized and all in window.c. Document the invariants we need to
maintain, and ensure that these invariants are properly kept, with
asserts in various places.

Extensive testing on gnome-shell did not bring up any issues, and this
is a considerable cleanup.
2014-08-16 14:59:13 -04:00
Jasper St. Pierre
06d55bf019 screen: Remove a bunch of screen checks
Now that we only manage one screen, this isn't necessary anymore.
2014-08-15 19:43:08 -04:00
Jasper St. Pierre
67be4e2bf3 window: Don't use GTK+ to fetch the drag threshold
Just look it up in GSettings ourselves.
2014-08-15 18:35:20 -04:00
Jasper St. Pierre
517e8f6fbd common: Create a better encoding for MetaGrabOp
MetaGrabOp is painful and tedious to work with, because it's a
sequential series of values, meaning we have to use a giant unreadable
switch statement to figure out some basic things about the value.

To solve this, modify the encoding for MetaGrabOp and for the specific
window grab operations so that they're a set of bitflags that we can
easily check.
2014-08-15 16:08:49 -04:00
Jasper St. Pierre
64a915a68d window: Fix build
I break things a lot now.
2014-08-15 16:08:25 -04:00
Jasper St. Pierre
d233238c64 window: Be better at filtering window grab mods
It turns out that Clutter doesn't actually filter NumLock / ScrollLock /
CapsLock from button events due to its terrible event translation code.

Check only the grab mods to check if it's unmodified.
2014-08-15 16:06:54 -04:00
Jasper St. Pierre
a5f993f269 window: Filter out buttons when checking if the event is unmodified 2014-08-15 08:41:10 -04:00
Jasper St. Pierre
31361e464a events: Make the ungrabbed button press handling more bullet proof
Instead of returning a value based on whether or not we handled it, we
have this logic: either we have taken a grab on the window, in which
case we have a grab op and have handled it ourselves, or we did not take
a grab and *need* to replay the event to the window.

Handle this in events.c by checking the grab operation in the same way
that we check the other grab ops.
2014-08-15 08:41:10 -04:00
Jasper St. Pierre
bb977c00ca window: Don't mark the event as handled for odd event combinations
This is an accidental regression from 7a109a1. If we mark the event as
handled, then we *need* to set grab_op, or do some other sort of
behavior, since we have a grab.
2014-08-15 08:41:09 -04:00
Jasper St. Pierre
f88c20f335 keybindings: Add an accessor for window grab modifiers
Since we're going to seal it away in the future.
2014-08-14 17:35:24 -04:00
Jasper St. Pierre
c98824bc9e window: Centralize the checks for the window grab modifiers
The code in the grab code was only checking for one of the modifiers to
be down, instead of all of them.
2014-08-14 17:35:24 -04:00
Jasper St. Pierre
69a35bb85f Remove support for the debugging window grabs feature
mutter doesn't really run nested in a useful way anymore.
2014-08-14 17:35:23 -04:00
Jasper St. Pierre
5f0fab2156 Conditionalize Wayland support again 2014-08-13 20:28:22 -04:00
Jasper St. Pierre
879407c10c window: Kill off a now-unnecessary state variable 2014-08-13 18:25:46 -04:00
Jasper St. Pierre
7fa15c74b4 window: Fix some minor constant type issues 2014-08-13 18:14:15 -04:00
Rui Matos
7d54631ebf backends: Make MetaBackend available to introspection
This moves meta-backend.h under meta/ and, for now, just exposes to
introspection the methods that we actually need in gnome-shell.

https://bugzilla.gnome.org/show_bug.cgi?id=734301
2014-08-07 11:31:59 +02:00
Jasper St. Pierre
cc839029b9 window: Don't leak the input region 2014-07-28 11:23:38 +02:00
Jasper St. Pierre
0e7221c361 window: Clean up keyboard-resizing code path 2014-07-27 15:03:38 +02:00
Carlos Garnacho
f28f5dc0b6 window: Implement single-touch window dragging
On X11 this works because only emulated pointer events are listened for. On
wayland, the single touch behavior must be enforced in touch events, ignoring
every other sequence.

https://bugzilla.gnome.org/show_bug.cgi?id=733631
2014-07-24 18:05:56 +02:00
Carlos Garnacho
38e4906f72 window: Use event data getters in event handling code
This makes these functions more independent wrt touch vs pointer events

https://bugzilla.gnome.org/show_bug.cgi?id=733631
2014-07-24 00:15:51 +02:00
Jasper St. Pierre
c5abf5ddbb window: Fix meta_window_move_resize_internal for the case of a sole ack
When a Wayland window acks our arrangement and we don't really have
anything to modify, we'll pass a sole flag of META_IS_WAYLAND_RESIZE
to meta_window_move_resize_internal using a garbage rect. The existing
code to calculate the new rectangle couldn't really handle this case,
and so the garbage rectangle accidentally got stored. Revamp the flag
checks to be more clear about it.

This fixes the weird positioning issues that sometimes appear when
resizing weston-terminal among others.
2014-07-14 17:07:31 -04:00
Jasper St. Pierre
8ff81bcc37 window: Force updating icons when initially loading them
Otherwise, Wayland windows will never get an icon.
2014-07-14 15:28:37 -04:00
Jasper St. Pierre
7159d3bc35 window: Remove the concept of surface_mapped
The implementation was just wrong. We now consider it an error to attach
a NULL buffer to an xdg_surface. Users should destroy the surface properly.
2014-07-14 14:49:58 -04:00
Jasper St. Pierre
941d202938 window: Move X11-specific icon code to MetaWindowX11 2014-07-14 12:15:23 -04:00
Jasper St. Pierre
5ea0cf8bab iconcache: Remove a useless icon_cache_free
All it does is poke a few fields. There is no point to it.
2014-07-14 12:02:58 -04:00
Jasper St. Pierre
df9a5f867f core: Remove useless meta_invalidate_default_icons implementation
This code was supposed to refresh our default icons when the theme
changed, but it actually was a no-op, since the default icons are cached
in a static variable in MetaUI.

I'm not sure the fact that the fallback icons don't update when the
theme changes is an important enough use case to keep working, but I'm
keeping the skeleton function there in case somebody wants to actually
fix it properly.
2014-07-14 12:00:34 -04:00
Jasper St. Pierre
740e7ddd69 window: Manage after setting the OR special case properties 2014-07-10 17:08:14 -04:00
Jasper St. Pierre
c10c8649f5 window: Reformat a comment 2014-07-08 12:45:34 -04:00
Jasper St. Pierre
82dce6758a window: Remove pending pings in unmanage
This makes sure that we see them for Wayland clients as well, and don't
time out and crash when we're accessing an invalid window / surface.

Spotted-by: Rui Matos <tiagomatos@gmail.com>
2014-07-08 12:17:08 -04:00
Jasper St. Pierre
024652bfb4 window: Set the surface to NULL when unmanaging 2014-07-08 12:14:20 -04:00
Jasper St. Pierre
c2abe43ee7 window: Only update the unconstrained rect when we actually moved/resized
Since Wayland configures are more of a hint to the client than anything,
we don't want to save the unconstrained rect when we're just hinting to
the client that it should resize, since it could ignore us. This would
get us stuck in a loop, since meta_window_move_resize_now would use the
unconstrained_rect to resize, and we don't remove the resize from the
queue if we have an outstanding request like that.

This fixes a bunch of traffic / CPU usage when trying to resize
weston-terminal.
2014-07-07 14:11:14 -04:00
Jasper St. Pierre
02220ed6c7 window: Don't eat events on O-R windows
For XWayland, we need to make sure to send out mouse events on O-R
windows, otherwise they won't get motion or button events.

The comment mentions being eaten for the compositor, but we already
bypass the compositor for all events that have a window. The return
value just controls whether we pass them to Wayland.
2014-07-01 14:41:38 -04:00
Jasper St. Pierre
af135c0b0b monitor-manager: Rename output_id to winsys_id
The output_id is more of an opaque identifier for the monitor, based on
its underlying ID from the windowing system. Since we also use the term
"output_id" for the output's index, rename our use of the opaque cookie
"output_id" to "winsys_id".
2014-07-01 13:24:34 -04:00
Jasper St. Pierre
42c972735e window: Don't treat an output_id of 0 as an invalid ID 2014-07-01 13:18:31 -04:00
Jasper St. Pierre
f1d8428650 window: Fix get_client_area_rect for the frame rect conversion
Specifically for CSD windows -- this was just absolutely wrong
before. This fixes weird painting and clipping artifacts for
CSD windows.
2014-06-27 11:58:39 -04:00
Jasper St. Pierre
a615f93060 window: Set custom frame extents to 0 if we don't have any
This is just a quick code cleanup.
2014-06-26 13:58:11 -04:00
Jasper St. Pierre
bb92054c86 window: Use g_object_notify_by_pspec 2014-06-26 10:31:22 -04:00
Jasper St. Pierre
4e4a6eb5d7 window: Use g_object_class_install_properties 2014-06-26 10:31:01 -04:00
Tom Beckmann
692acbd986 window: Add a property for on_all_workspaces
Some plugins and extensions want to be able to know when the sticky
field of a window changes, so add a property for it and allow them
to connect to the notify::on-all-workspaces signal.
2014-06-26 10:31:00 -04:00
Florian Müllner
967b6c33df window: Add user_op parameter to update_monitor()
When workspaces-only-on-primary is set and a window is moved back to the
primary, we also move it to the active workspace to avoid the confusion
of a visible window suddenly disappearing when crossing the monitor border.
However when the window is not actually moved by the user, preserving the
workspace makes more sense - we already do this in some cases (e.g. when
moving between primary monitors), but miss others (unplugging the previous
monitor); just add an explicit user_op parameter as used elsewhere to cover
all exceptions.

https://bugzilla.gnome.org/show_bug.cgi?id=731760
2014-06-24 23:42:06 +02:00
Florian Müllner
00c7a27732 window: Keep track of preferred output
Remember the last monitor a window was moved to by user action and
try to move it back on monitor changes; this should match user
expectations much better when a monitor is unplugged temporarily.

https://bugzilla.gnome.org/show_bug.cgi?id=731760
2014-06-24 23:42:06 +02:00
Florian Müllner
048ba353c4 window: Don't make windows on non-primaries sticky on restart
When workspaces-only-on-primary is set, a window can be on all
workspaces either because it is on a non-primary workspace, or
because it was explicitly made sticky. Only the latter is reflected
in _NET_WM_STATE, but both will result in a "magic" _NET_WM_DESKTOP,
which we (and probably other WMs) use to set the initial sticky state.
So to avoid confusing other WMs (or ourselves), make sure to only
have _NET_WM_STATE_STICKY reflected in _NET_WM_DESKTOP when unmanaging.
2014-06-24 23:01:59 +02:00
Florian Müllner
555e2f6de2 Revert "window: Move placement code from the constraints path"
Window state like maximization and minimization should be preserved
over restarts - in a patch review, this would qualify as "needs-work",
so revert the cleanup until the issues are fixed.

This reverts commit dc6decefb5.
2014-06-24 22:59:06 +02:00
Jasper St. Pierre
dc6decefb5 window: Move placement code from the constraints path
This way, it's implemented as a special case in move_resize_internal,
which makes it a lot easier to manage.
2014-06-17 11:40:49 -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
188e4e1b92 window: Rename get_input_rect to get_buffer_rect
With get_input_region existing, get_input_rect is a misnomer. Really,
it's about the geometry of the output surface, and it's only used that
way in the compositor code.

Way back when in GNOME 3.2, get_input_rect was added when we added
invisible borders. get_outer_rect was always synonymous with server-side
geometry of the toplevel. get_outer_rect was used for both user-side
policy (the "frame rect") and to get the geometry of the window.

Invisible borders were meant to extend the input region of the frame
window silently. Since most users of get_outer_rect cared about the
frame rect, we kept that the same and added a new method, get_input_rect
to get the full rect of the framed window with all invisible borders for
input kept on.

As time went on and CSD and Wayland became a reality, the relationship
between the server-side geometry and the "frame rect" became more
complicated, as can be evidenced by the recent commits. Since clients
don't tend to be framed anymore, they set their own input region.

get_buffer_rect is also sort of a poor name, since X11 doesn't really
have buffers, but we don't really have many other alternatives.

This doesn't change any of the code, nor the meaning. It will always
refer to the rectangle where the toplevel should be placed.
2014-06-17 10:33:52 -04:00
Jasper St. Pierre
9d5273bb15 window: Fix get_input_rect in a hacky way
All of the users of get_input_rect don't actually want a synthesized
input rect based off of the current margins. What they really want is
the last-configured size of the toplevel window.

Since we don't properly track this anymore in the generic MetaWindow,
use XGetWindowAttributes to fetch a server-side rectangle. This is a
bad layer violation, but since the window geometry code will have to
be rewritten anyway for the Wayland set_window_geometry, let's just
push a hacky fix for now.
2014-06-16 18:34:07 -04:00
Jasper St. Pierre
3c0fae74f1 window: Move get_toplevel_xwindow to window-x11 2014-06-16 18:29:38 -04:00
Jasper St. Pierre
89cdfc9194 display: Use G_SOURCE_CONTINUE / G_SOURCE_REMOVE 2014-06-12 17:46:23 -04:00
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