Commit Graph

785 Commits

Author SHA1 Message Date
Pavel Vasin
970a446bd8 window: Add missing chain-up for finalize()
https://bugzilla.gnome.org/show_bug.cgi?id=698710
2013-04-29 14:58:31 +02:00
Pavel Vasin
5b6621811c barrier: Fix memory leak
https://bugzilla.gnome.org/show_bug.cgi?id=698710
2013-04-29 14:58:28 +02:00
Simon McVittie
c2a9ccb7e2 Let the UI layer (via the core) construct the frame mask
This essentially just moves install_corners() from the compositor, through
the core, into the UI layer where it arguably should have been anyway,
leaving behind stub functions which call through the various layers. This
removes the compositor's special knowledge of how rounded corners work,
replacing it with "ask the UI for an alpha mask".

The computation of border widths and heights changes a bit, because the
width and height used in install_corners() are the
meta_window_get_outer_rect() (which includes the visible borders but not
the invisible ones), whereas the more readily-available rectangle is the
MetaFrame.rect (which includes both). Computing the same width and height
as meta_window_get_outer_rect() involves compensating for the invisible
borders, but the UI layer is the authority on those anyway, so it seems
clearer to have it do the calculations from scratch.

Bug: https://bugzilla.gnome.org/show_bug.cgi?id=697758
Signed-off-by: Simon McVittie <simon.mcvittie@collabora.co.uk>
Reviewed-by: Jasper St. Pierre <jstpierre@mecheye.net>
2013-04-17 13:35:06 +01:00
Stef Walter
4608cb6027 Fix use of uninitialized variables
If mutter is going to -Werror by default, then it can play footloose
and fancy free with this sorta stuff.

https://bugzilla.gnome.org/show_bug.cgi?id=698179
2013-04-17 11:58:43 +02:00
Rui Matos
c7dc6928a9 keybindings: Fix ungrabbing of keys
XUngrabKey() doesn't work for XI2 grabs and XI2 doesn't provide API
with similar functionality. As such, we have to refactor the code a
bit to be able to call XIUngrabKeycode() for each key binding, then
reload keybindings and finally grab the new ones.

https://bugzilla.gnome.org/show_bug.cgi?id=697003
2013-04-10 10:49:24 +02:00
Tomeu Vizoso
58496de595 Give a title to the MetaWorkspace page in the API docs
https://bugzilla.gnome.org/show_bug.cgi?id=695935
2013-03-18 23:08:24 +01:00
Jasper St. Pierre
eefa62bcd4 screen: Fix a copy/paste error from the fullscreen tracking
This was causing a warning on shutdown.
2013-03-18 16:29:25 -04:00
Owen W. Taylor
8a33880c00 Don't configure a window before it responds to _NET_WM_SYNC_REQUEST
In 97a4cc8c, we accidentally lost the check that kept us from
sending multiple configures to a window before it responds to
_NET_WM_SYNC_REQUEST. So _NET_WM_SYNC_REQUEST stopped working
properly. Add a check back with the same effect.

https://bugzilla.gnome.org/show_bug.cgi?id=696091
2013-03-18 15:10:18 -04:00
Owen W. Taylor
7a8c45dda8 Handle spontaneous frames during a resize
During a resize, if we don't have a configure pending, then a counter
change shouldn't trigger anything other than the normal drawing:
it's just a spontaneous frame from the application. So don't try
to update the position or remove our timeout ID.

https://bugzilla.gnome.org/show_bug.cgi?id=696091
2013-03-18 15:10:18 -04:00
Owen W. Taylor
5ceffe86ee MetaScreen: Add tracking of whether there are fullscreen windows
Trying to track the fullscreen status outside of Mutter, as GNOME Shell
was doing previously, was very prone to errors, because Mutter has a
very tricky definition of when a window is set to be fullscreen and
*actually* acting like a fullscreen window.

 * Add meta_screen_get_monitor_in_fullscreen() and an
   ::in-fullscreen-changed signal. This allows an application to
   track when there are fullscreen windows on a monitor.

 * Do the computation of fullscreen status in a "later" function that
   runs after showing, so we properly take focus into account.

 * To get ordering of different phases right, add more values
   to MetaLaterType.

 * Add auto-minimization, similar to what was added to GNOME Shell
   earlier in this cycle - if a window is set to be fullscreen, but
   not actually fullscreen, minimize.

https://bugzilla.gnome.org/show_bug.cgi?id=649748
2013-03-18 13:05:22 -04:00
Florian Müllner
49df033b4e window: Remove obsolete code
Since the tile mode is now always reset on maximize(), this code
no longer does anything (not to mention that side-by-side tiled
windows haven't snapped back for a while now).

https://bugzilla.gnome.org/show_bug.cgi?id=682779
2013-03-18 16:43:08 +01:00
Florian Müllner
ac3465ffbb window: Reset tile-mode on maximization
We used to restore side-by-side tiling when unmaximizing, so we
kept the tile-mode during maximization. Since commit 10d53fc7d
there's no longer a good reason to do so, and it can result in
tile previews being shown erroneously on window drag operations
without motion (double-click on titlebar), so reset the tile
mode in maximize().

https://bugzilla.gnome.org/show_bug.cgi?id=682779
2013-03-18 16:43:08 +01:00
Florian Müllner
884ab602cb window: Force NORMAL layer for tile preview
The tile preview is expected to be shown underneath the focus window.
However the code that restacks the preview broke when override-redirect
windows were moved to a separate window group.
To fix, special-case tile previews to put them in the NORMAL layer.

https://bugzilla.gnome.org/show_bug.cgi?id=696053
2013-03-18 16:20:07 +01:00
Tomeu Vizoso
2efed44257 Add a meaningful name and description to all sections/files in the API docs
https://bugzilla.gnome.org/show_bug.cgi?id=695641
2013-03-14 18:11:04 -04:00
Tomeu Vizoso
be46869782 docs: Fix cross-reference generation
https://bugzilla.gnome.org/show_bug.cgi?id=676856
2013-03-14 18:02:43 -04:00
Tomeu Vizoso
e0b698d365 Fix gobs of gtk-doc warnings
https://bugzilla.gnome.org/show_bug.cgi?id=676856
2013-03-14 18:02:43 -04:00
Tomeu Vizoso
edeac1de09 Remove meta_display_get_atom and MetaAtom
They aren't used and MetaAtom confused gtk-doc because it's defined
with a macro.

https://bugzilla.gnome.org/show_bug.cgi?id=676856
2013-03-14 17:56:36 -04:00
Tomeu Vizoso
9281a1c191 Escape a few < and > from the API docs
https://bugzilla.gnome.org/show_bug.cgi?id=676856
2013-03-14 17:56:36 -04:00
Owen W. Taylor
97a4cc8c9b Make handling of windows that don't respond to _NET_WM_SYNC_REQUEST reliable
Previously, we were handling failure to respond to _NET_WM_SYNC_REQUEST
in the code path for throttling motion events. But this meant that
if a window didn't respond to _NET_WM_SYNC_REQUEST and there were no
motion events - for a keyboard resize, or after the end of the grab
operation - it would end up in a stuck state.

Use a separate per-window timeout to reliably catch the failure to respond
to _NET_WM_SYNC_REQUEST.

https://bugzilla.gnome.org/show_bug.cgi?id=694046
2013-03-14 08:01:28 -04:00
Owen W. Taylor
592374bc62 Fix freezing of windows with keyboard resizing
During resizing we froze window updates when configuring the
window, and unfroze the window updates when processing the
next resize. This wasn't absolutely reliable, because we might
not have a next resize. Instead tie window freezing more
directly to the current sync request value - a window is
frozen until it catches up with the last value we sent it
in _NET_WM_SYNC_REQUEST.

Testing with unresponsive clients showed that there was a bug
where window->disable_sync once set, would not actually disable
sync, but it *would* disable noticing that the client was
unresponsive for the next resize. Fix that by checking for
->disable_sync before sending _NET_WM_SYNC_REQUEST.

https://bugzilla.gnome.org/show_bug.cgi?id=694046
2013-03-14 07:59:57 -04:00
Adel Gadllah
381a9c2650 core: Remove the eventqueue
It is unused.

https://bugzilla.gnome.org/show_bug.cgi?id=695269
2013-03-06 09:17:12 +01:00
Owen W. Taylor
6e02fb80c4 Always send _NET_WM_FRAME_DRAWN for newly created windows
Send a _NET_WM_FRAME_DRAWN for each newly created window, as required
by the specification. This avoids a race where a window might be created
frozen but already unfrozen by the time we first see fetch the
counter value.

Remove a duplicate call to meta_compositor_set_updates_frozen() which
was called before the MetaWindowActor is created and hence did nothing.

https://bugzilla.gnome.org/show_bug.cgi?id=694771
2013-03-04 15:36:13 -05:00
Pavel Vasin
98b0a37442 Free memory allocated by XIQueryPointer()
https://bugzilla.gnome.org/show_bug.cgi?id=695135
2013-03-04 19:07:23 +01:00
Ray Strode
377e2ed8a5 keybindings: filter overlay key even when not-modal
mutter currently only filters the overlay key through the shell
when there is a grab operation and that grab operation belongs to the
shell (because the shell is pushModal'd). This means the shell can't
filter out overlay key press events events at startup (since the shell
isn't normally modal).

This commit changes the code to always run the shell filtering code,
even when the shell is not modal.

https://bugzilla.gnome.org/show_bug.cgi?id=694837
2013-03-04 11:57:17 -05:00
Ray Strode
773ae8dc65 core: make session registration an explicit step
gnome-shell shouldn't announce to the session manager it's
"ready" until it's fully initialized.  It currently tells
the session manager it's ready as soon as it hits the main
loop. This causes nautilus in classic mode to start before
we have workspaces initialized.

https://bugzilla.gnome.org/show_bug.cgi?id=694876
2013-03-01 11:30:07 -05:00
Florian Müllner
a39cabfadb keybindings: Add external grab API
During compositor grabs, all global keybindings that don't go
through mutter's keybinding system are blocked. To allow other
processes to make use of it, gnome-shell will expose a simple
grab API on DBus; for this, add API to grab key combos directly
instead of parsing accelerators stored in GSettings.

https://bugzilla.gnome.org/show_bug.cgi?id=643111
2013-03-01 16:11:43 +01:00
Florian Müllner
4df3e987c6 keybindings: Generalize mechanism to generate dynamic keybinding actions
https://bugzilla.gnome.org/show_bug.cgi?id=643111
2013-03-01 16:11:42 +01:00
Ray Strode
de36d51b91 screen: fix meta_screen_get_monitor_for_rect for 0x0 rects
meta_screen_get_monitor_for_rect will return the monitor that
a given rect belongs in (choosing the "best" monitor based on
overlap, if there are overlapping monitors).

It doesn't work with 0x0 rects, though.

This commit fixes that.

https://bugzilla.gnome.org/show_bug.cgi?id=694725
2013-02-27 21:35:30 -05:00
Giovanni Campagna
e6d5e98c9d MetaWindow: fix annotation
caller-allocates makes sense only for structure, and gjs will complain
if used on anything else

https://bugzilla.gnome.org/show_bug.cgi?id=694801
2013-02-27 18:00:01 +01:00
Adel Gadllah
2a773e0c85 window: Add get_all_monitors
Add a method that returns the indices of the monitors a window
is on.

https://bugzilla.gnome.org/show_bug.cgi?id=646861
2013-02-25 22:05:42 +01:00
Ray Strode
2cafb8be2d window: fix meta_window_is_remote across hostname changes
meta_window_is_remote compares a cached copy of the system hostname
with the hostname of the client window
(as presented by the WM_CLIENT_MACHINE property).

Of course, the system hostname can change at any time, so caching
it is wrong. Also, the WM_CLIENT_MACHINE property won't necessarily
change when the system hostname changes, so comparing it with the
new system hostname is wrong, too.

This commit makes the code call gethostname() at the time
WM_CLIENT_MACHINE is set, check whether it's remote then, and cache
that value, rather than comparing potentially out of sync hostnames
later.

https://bugzilla.gnome.org/show_bug.cgi?id=688716
2013-02-20 16:02:10 -05:00
Ray Strode
64544fa0ed window: deduplicate is_remote logic
set_title_text does the equivalent of meta_window_is_remote on its
own.

This commit changes set_title_text to just use meta_window_is_remote.

https://bugzilla.gnome.org/show_bug.cgi?id=688716
2013-02-20 15:28:31 -05:00
Jasper St. Pierre
7e61ef0936 display: Don't put minimized windows at the back of alt-tab
Minimizing a window should not change its position in the alt-tab
list.

https://bugzilla.gnome.org/show_bug.cgi?id=693991
2013-02-18 13:11:55 -05:00
Adel Gadllah
e9709b7ff9 window: Add is_screen_sized method
Add a method that returns whether the window occupies
the whole screen (i.e all montiors).
2013-02-18 14:10:27 +01:00
Giovanni Campagna
027593faa5 Keybindings: reverse key combination read from settings
Window menus use the first key combination for a binding to show the
acceleration, so the list must be in the right configured order, which
is the opposite of what's built by g_slist_prepend()

https://bugzilla.gnome.org/show_bug.cgi?id=694045
2013-02-17 21:52:19 +01:00
Jasper St. Pierre
b0774d795c screen: Select for pointer events on the guard window
The guard window is effectively the background window, as it sits
in between live windows and minimized windows. This gives us a nice
easy place to allow users to allow users to right-click or long-press
on the wallpaper.

https://bugzilla.gnome.org/show_bug.cgi?id=681540
2013-02-17 15:43:38 -05:00
Adel Gadllah
a6a9d3f448 window: Add meta_window_is_monitor_sized
We duplicate this checks in multiple places so lets add this to
avoid code duplication.
2013-02-17 21:42:01 +01:00
Owen W. Taylor
d900d83522 MetaWindowActor: Go back to freezing affecting actor geometry
We do, in fact, need freezing to affect window geometry, so that
move-resize operations (such as an interactive resize from the
left, or a resize of a popup centered by the application) occur
atomically.

So to make map effects work properly, only exclude the initial
placement of a window from freezing. (In the future, we may want
to consider whether pure moves of a window being done in response
to a user drag should also be excluded from freezing.)

Rename meta_window_sync_actor_position() to
meta_window_sync_actor_geometry() for clarity.

https://bugzilla.gnome.org/show_bug.cgi?id=693922
2013-02-15 21:48:25 -05:00
Jasper St. Pierre
e8b0c11703 barrier: Add a time field to MetaBarrierEvent
This was used in gnome-shell, but last-minute changes and multiple
branch confusion on my part meant the field actually never got added.

https://bugzilla.gnome.org/show_bug.cgi?id=693854
2013-02-15 16:49:03 -05:00
Owen W. Taylor
3e38a48c40 meta_spew_xi2_event: fix crash-causing typo 2013-02-15 15:52:34 -05:00
Owen W. Taylor
5876f2e3e5 Fix corner cases where _NET_WM_FRAME_DRAWN might be missed
The WM spec requires _NET_WM_FRAME_DRAWN to *always* be sent when
there is an appropriate update to the sync counter value. We were
potentially missing _NET_WM_FRAME_DRAWN when an application did a
spontaneous update during an interactive resize and during effects.
Refactor the code to always send _NET_WM_FRAME_DRAWN, even when
a window is frozen.

https://bugzilla.gnome.org/show_bug.cgi?id=693833
2013-02-14 16:21:26 -05:00
Owen W. Taylor
aeb589c176 MetaWindow: fix detecting the response to an extended _NET_WM_SYNC_REQUEST
During resizing, An odd counter value (indicating the beginning of a frame)
shouldn't cause us to redraw and start a new frame, only an even counter
value. This was causing the frozen state for the window frame counter to
overlap the frozen state for the resize, causing the window not to be
updated.

https://bugzilla.gnome.org/show_bug.cgi?id=693833
2013-02-14 16:21:14 -05:00
Adel Gadllah
579bf2105e display: Pass timestamp to meta_display_end_grab_op
We need to pass the timestamp not the event detail to meta_display_end_grab_op

https://bugzilla.gnome.org/show_bug.cgi?id=690580
2013-02-13 18:32:57 +01:00
Owen W. Taylor
0503f6bb9a Consistently use meta_grab_op_is_resizing() for _NET_WM_SYNC_REQUEST
In different places we checked the grab op differently when determing
whether we are using _NET_WM_SYNC_REQUEST. This was somewhat covered
up previously by the fact that we only had a sync alarm when using
_NET_WM_SYNC_REQUEST, but that is no longer the case, so consistently
use meta_grab_op_is_resizing() everywhere.

https://bugzilla.gnome.org/show_bug.cgi?id=685463
2013-02-13 09:48:27 -05:00
Owen W. Taylor
87fe9685b5 Distinguish "no delay" frames from spontaneous drawing
When a client is drawing as hard as possible (without sleeping
between frames) we need to draw as soon possible, since sleeping
will decrease the effective frame rate shown to the user, and
can also result in the system never kicking out of power-saving
mode because it doesn't look fully utilized.

Use the amount the client increments the counter value by when
ending the frame to distinguish these cases:

 - Increment by 1: a no-delay frame
 - Increment by more than 1: a non-urgent frame, handle normally

https://bugzilla.gnome.org/show_bug.cgi?id=685463
2013-02-13 09:48:27 -05:00
Owen W. Taylor
fcc178ee8c Use XSyncSetPriority()
Use XSyncSetPriority() to prioritize the compositor above applications
for X server priority. In practice, this makes little difference because
the Xorg "smart scheduler" will schedule in a single application for
time slices that exceed the frame drawing time, but it's theoretically
right and might make a difference if the X server scheduler is improved.

https://bugzilla.gnome.org/show_bug.cgi?id=685463
2013-02-13 09:48:26 -05:00
Owen W. Taylor
790bfcad9a MetaWindow: always resize the frame first when we have synchronization
Resizing the frame triggers creation of a new backing pixmap for the
window, so we should do that first before we resize the client window
and mess up the contents of the old backing pixmap.

https://bugzilla.gnome.org/show_bug.cgi?id=685463
2013-02-13 09:48:26 -05:00
Owen W. Taylor
fbfab93c63 Send _NET_WM_FRAME_DRAWN messages
When the application provides the extended second counter for
_NET_WM_SYNC_REQUEST, send a client message with completion
information after the next redraw after each counter update
by the application.

https://bugzilla.gnome.org/show_bug.cgi?id=685463
2013-02-13 09:48:26 -05:00
Owen W. Taylor
70c0d39fa7 Add support for an extended style of _NET_WM_SYNC_REQUEST_COUNTER
If an application provides two values in _NET_WM_SYNC_REQUEST_COUNTER,
use that as a signal that the applications wants an extended behavior
where it can update the counter as well as the window manager. If the
application updates the counter to an odd value, updates of the
window are frozen until the counter is updated again to an even value.

https://bugzilla.gnome.org/show_bug.cgi?id=685463
2013-02-13 09:48:26 -05:00
Owen W. Taylor
7d43bde019 Support properties with lists of XSyncCounter
Add META_PROP_VALUE_SYNC_COUNTER_LIST for a property that contains
multiple XSyncCounter values.

https://bugzilla.gnome.org/show_bug.cgi?id=685463
2013-02-13 09:48:26 -05:00