1
0
Fork 0
Commit graph

1948 commits

Author SHA1 Message Date
Jonas Ådahl
c22bee19e1 Add --nested command line argument
As of "core: start as wayland display server when
XDG_SESSION_TYPE=wayland" it is no longer possible to run a nested
mutter Wayland session on top of another Wayland session. This patch
adds a command line argument to make it possible to force mutter to
start as a nested compositor.

https://bugzilla.gnome.org/show_bug.cgi?id=758658
2016-02-22 17:03:07 +08:00
Carlos Garnacho
56beedf9f2 core: Refactor startup notification into a separate object
This is kind of in a middle ground at the moment. Even though it
handles sequences not coming from libsn, they're added nowhere at
the moment, we'll rely on the app launch context being in the x11
side at the moment.

Also, even though we do create internal sequence objects, we keep
exposing SnStartupSequences to make gnome-shell happy, we could
consider making this object "public" (and the sequence objects with
it), things stay private at the moment.

https://bugzilla.gnome.org/show_bug.cgi?id=762268
2016-02-19 17:41:03 +01:00
Olivier Fourdan
4e82a751fb window: check for possible loop in transients
If a broken or naughty application tries set up its windows to create
a loop in the transient relationship, mutter will hang, looping forever
in meta_window_foreach_ancestor()

To avoid looping infinitely at various point in the code, check for a
possible loop when setting the transient relationship and deny the
request to set a window transient for another if that would create a
loop.

Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=759299
2016-02-18 09:03:56 +01:00
Jonas Ådahl
bc1dd1cee4 MetaBorder: Use float constants and functions instead of double variants
We calculate with floats, so lets use that type throughout.

https://bugzilla.gnome.org/show_bug.cgi?id=744104
2016-02-16 19:02:48 +08:00
Jonas Ådahl
f0f638d2bd Move out generic math parts out of the native barrier implementation
In order to reuse some vector math for pointer confinement, move out
those parts to its own file, introducing the types old types
"MetaVector2" and "MetaLine2" outside of meta-barrier-native.c, as well
as introducing MetaBorder which is a line, with a blocking direction.

https://bugzilla.gnome.org/show_bug.cgi?id=744104
2016-02-16 19:02:48 +08:00
Florian Müllner
46eb682c83 Revert "window: Remove old tiling code"
This reverts commit 8bded7d497.
2016-01-10 15:16:09 +01:00
Florian Müllner
3aea8d8ce6 Revert "Add "size states" which save window size information"
This reverts commit 2c7ef2269f.
2016-01-10 15:16:09 +01:00
Florian Müllner
40c3c69435 Revert "window: Add new tiling code"
This reverts commit 50e3e3b929.
2016-01-10 15:16:08 +01:00
Florian Müllner
8071e5b149 Revert "frame: Don't allow resizing of edges that are constrained"
This reverts commit 8a481b3e10.
2016-01-10 15:16:06 +01:00
Jasper St. Pierre
8a481b3e10 frame: Don't allow resizing of edges that are constrained
https://bugzilla.gnome.org/show_bug.cgi?id=751857
2016-01-09 18:11:15 -08:00
Jasper St. Pierre
50e3e3b929 window: Add new tiling code
The new tiling code, instead of based around "tiling states", is instead
based around constrained edges. This allows us to have windows that have
three constrained edges, but keep one free-floating, e.g. a window tiled
to the left has the left, top, and bottom edges constrained, but the
right edge can be left resizable.

This system also is easily extended to support corner tiling. We also,
using the new "size state" system, also keep normal, tiled, and
maximized sizes independently, allowing the maximize button to bounce
between maximized and tiled states without reverting to normal in
between. Dragging from the top will always restore the normal state,
though.

https://bugzilla.gnome.org/show_bug.cgi?id=751857
2016-01-09 18:09:30 -08:00
Jasper St. Pierre
2c7ef2269f Add "size states" which save window size information
https://bugzilla.gnome.org/show_bug.cgi?id=751857
2016-01-09 18:08:35 -08:00
Jasper St. Pierre
8bded7d497 window: Remove old tiling code
We'll soon replace this with a better scheme

https://bugzilla.gnome.org/show_bug.cgi?id=751857
2016-01-09 18:08:32 -08:00
Rui Matos
3a2cd3389a window: Re-evaluate window visibility when making it transient
In case a window is hidden when we're ordered to make it transient to
a different parent we must re-evaluate its visibility status or we'll
get into an inconsistent state where the parent is visible and the
child isn't.

https://bugzilla.gnome.org/show_bug.cgi?id=759297
2016-01-06 18:56:07 +01:00
Rui Matos
88acfb8e60 window: Focus windows on button press regardless of modifier state
This seems like a more generally useful and intuitive behavior. Note
that, in X sessions, this is what already happened in practice since
meta_display_begin_grab_op() calls meta_window_grab_all_keys() which,
on X11, does meta_window_focus().

https://bugzilla.gnome.org/show_bug.cgi?id=756789
2016-01-05 20:42:05 +01:00
Rui Matos
8e22dce5d7 window: Remove a spurious meta_verbose()
This was duplicated here by mistake in the big re-work commit
7a109a18af .

https://bugzilla.gnome.org/show_bug.cgi?id=756789
2016-01-05 20:42:04 +01:00
Jonas Ådahl
213f0fa160 window: Update the stack after setting the transient_for field
Don't update the stack until after setting the window->transient_for
field. Updating before will cause the stack transient-for constraint to
be missing until the next time constraints are applied.

https://bugzilla.gnome.org/show_bug.cgi?id=755606
2015-12-23 14:59:36 +08:00
Jasper St. Pierre
8cc345fcf5 window: Allow minimizing windows which don't advertise support for it
Wine removes the minimize func from its Motif hints on full-screen
windows, because, as the Win32 API literally says, the minimize button
is indeed not visible on full-screen windows.

Given that this code was added to prevent minimizing a panel by
accident, I don't necessarily think that it's relevant anymore.

https://bugzilla.gnome.org/show_bug.cgi?id=758186
2015-12-05 10:46:21 -08:00
Carlos Garnacho
96b5042dda core: Unset "pointer emulating" sequence lazily
Unsetting it in meta_display_handle_event() will make the pointer
emulation checks fail on TOUCH_END event handlers across clutter
actors, the sequence should still be considered as pointer emulating
at that time.

As we don't have a way to hook this post clutter event handling,
instead unset/reset it lazily on the next pointer emulating TOUCH_BEGIN
event, the checks would already fail on other sequences, even if the
pointer emulating touch ended earlier. The only extra thing we need
to take care about is sequence collision, at which point it's safe to
just unset the stored sequence if its new incarnation isn't flagged/
deemed as pointer emulating.

https://bugzilla.gnome.org/show_bug.cgi?id=756754
2015-12-04 11:47:01 +01:00
Carlos Garnacho
c625d2ee9d core: Make meta_window_handle_ungrabbed_event() touch-aware
This fixes the effects of this function on touchscreens in wayland
(most notably, window raising & focusing).
2015-11-25 18:00:36 +01:00
Marek Chalupa
99c0b82b15 window: do not force placing window if it is not mapped
When managing window, we queue showing the window.
Under wayland, if we commit surface quickly enough,
the showing is unqueued and commit procedure takes care
of mapping and placing the window. In the oposite case,
queue is processed before client sets all we need and
then we have wrong size of window, which leads to broken placement.
Therefore force placement in queue only if the window should already
be mapped. If it is not mapped, we don't care where it is anyway.

https://bugzilla.gnome.org/show_bug.cgi?id=751887
2015-11-16 10:21:09 +08:00
Ray Strode
8ec0c99ff4 core: start as wayland display server when XDG_SESSION_TYPE=wayland
This commit gets rid of the need for --display-server and
--wayland when mutter detects that a wayland session is registered.

https://bugzilla.gnome.org/show_bug.cgi?id=741666
2015-11-09 10:25:11 -05:00
Ray Strode
db4355ba1e core: move backend setting to helper function
This paves the way for making the backend setting
be more automatic.

https://bugzilla.gnome.org/show_bug.cgi?id=741666
2015-11-06 16:22:40 -05:00
Rui Matos
76e816a14f window: Properly update window->monitor for the desktop window
We don't want to move the desktop window but we still need to update
window->monitor or otherwise we'll be left with a pointer to invalid
memory.

https://bugzilla.gnome.org/show_bug.cgi?id=757148
2015-10-27 14:33:34 +01:00
Florian Müllner
ffd95c2ad5 theme: Complete removal of "fringe" titlebar button support
We have been ignoring those buttons since 3.16 after they had been
broken in the default theme for a couple of versions. As nobody
appears to miss them, it's time to remove them for good.
2015-10-16 04:13:14 +02:00
Cosimo Cecchi
a692fd3808 compositor: add hooks for fullscreen and unfullscreen animations
https://bugzilla.gnome.org/show_bug.cgi?id=707248
2015-10-12 22:28:30 -04:00
Owen W. Taylor
d7f544f42e META_DEBUG_STACK: Fix message about the dumped window order
A change in the code made the windows list bottom-to-top instead
of top-to-bottom, but the message printed out still said
"Top to bottom."
2015-10-12 09:52:25 -04:00
Owen W. Taylor
1ab8b854df Improve debug logging of Wayland windows
Displaying all Wayland windows with the XID of 0x0 makes it hard
to figure out what is going on ... use the recently-added
window->stamp to show Wayland windows as W1/W2/W3...
2015-10-12 09:52:25 -04:00
Owen W. Taylor
ae7aabd5de Protect against stray calls to meta_display_end_grab_op()
If end_grab_op() is called when there's a "compositor grab"
rather than a grab op is in effect, silently return.

https://bugzilla.gnome.org/show_bug.cgi?id=745785
2015-10-12 09:50:48 -04:00
Jonas Ådahl
130807a308 wayland: Don't pre-multiply root cursor sizes with primary monitor scale
We cannot use the XSETTINGS value for cursor theme size because
gnome-settings-daemon already multiplies it by the primary monitor's
scale.

https://bugzilla.gnome.org/show_bug.cgi?id=755099
2015-10-04 14:17:14 +08:00
Colin Walters
6190ae3873 window: Remove invalid (transfer) annnotations
This tripped a new g-i warning; see
https://bugzilla.gnome.org/show_bug.cgi?id=752047
2015-09-27 16:42:01 -04:00
Florian Müllner
4e63c95c02 testboxes: Don't avoid parameter list 2015-09-24 03:08:23 +02:00
Florian Müllner
bc00f118f3 Avoid shadowing existing variables 2015-09-24 03:08:22 +02:00
Florian Müllner
5801b5518f Annotate functions to improve compiler diagnostics 2015-09-24 03:01:51 +02:00
Florian Müllner
25a796afc6 Fix constness warnings 2015-09-24 03:01:51 +02:00
Jonas Ådahl
79c86ae890 Support scaling of cursor sprites given what output they are on
This commits refactors cursor handling code and plugs in logic so that
cursor sprites changes appearance as it moves across the screen.
Renderers are adapted to handle the necessary functionality.

The logic for changing the cursor sprite appearance is done outside of
MetaCursorSprite, and actually where depends on what type of cursor it
is. In mutter we now have two types of cursors that may have their
appearance changed:

 - Themed cursors (aka root cursors)
 - wl_surface cursors

Themed cursors are created by MetaScreen and when created, when
applicable(*), it will extend the cursor via connecting to a signal
which is emitted everytime the cursor is moved. The signal handler will
calculate the expected scale given the monitor it is on and reload the
theme in a correct size when needed.

wl_surface cursors are created when a wl_surface is assigned the
"cursor" role, i.e. when a client calls wl_pointer.set_cursor. A
cursor role object is created which is connected to the cursor object
by the position signal, and will set a correct texture scale given what
monitor the cursor is on and what scale the wl_surface's active buffer
is in. It will also push new buffers to the same to the cursor object
when new ones are committed to the surface.

This commit also makes texture loading lazy, since the renderer doesn't
calculate a rectangle when the cursor position changes.

The native backend is refactored to be triple-buffered; see the comment
in meta-cursor-renderer-native.c for further explanations.

* when we are running as a Wayland compositor

https://bugzilla.gnome.org/show_bug.cgi?id=744932
2015-09-13 21:26:22 +08:00
Jonas Ådahl
b01f95cfdd Make MetaCursorSprite a GObject
To easier track lifetime and utilize other GObject features, make
MetaCursorSprite a GObject.

https://bugzilla.gnome.org/show_bug.cgi?id=744932
2015-08-28 09:52:30 +08:00
Jonas Ådahl
4b667d1e09 Rename MetaCursorReference to MetaCursorSprite
It isn't really a reference to a MetaCursor enum, but a reference
counted cursor sprite, and enum value.

https://bugzilla.gnome.org/show_bug.cgi?id=744932
2015-08-28 09:52:30 +08:00
Jasper St. Pierre
a5417ebee1 cursor: Move check for cursor NULL-ness
Before, it used to be in the screen, but now,
meta_cursor_reference_from_theme can never fail. Move it to where we
load the images from the cursor name.
2015-08-18 13:59:29 -07:00
Rui Matos
07f533f617 window: Remove fullscreen_after_placement special case
This was introduced in commit c6793d477a
to prevent window self-maximisation. It turns out that that bug seems
to have been fixed meanwhile in a different way since the reproducer
in https://bugzilla.gnome.org/show_bug.cgi?id=461927#c37 now works
fine with this special handling removed.

In fact, failing to set window->fullscreen immediately when loading
the initial set of X properties causes us to create a UI frame for a
window that sets _NET_WM_STATE_FULLSCREEN.

This, in turn, might cause the fullscreen constrain code to fail if
the window also sets min_width/min_height size hints to be the monitor
size since the UI frame size added to those makes the rectangle too
big to fit the monitor. If the window doesn't set these hints, we
fullscreen it but the window will get sized such that the UI frame is
taken into account while it really shouldn't (see the reproducer
above).

https://bugzilla.gnome.org/show_bug.cgi?id=753020
2015-07-30 15:27:01 +02:00
Florian Müllner
0a9511b24b window: Remove duplicated code
meta_window_change_workspace_without_transients() already does
exactly that.
2015-07-23 12:13:45 +02:00
Florian Müllner
17438ced91 core: Remove meta_core_get_frame_workspace() declaration
The definition was removed long ago in commit ff33209e1f ...
2015-07-23 12:13:45 +02:00
Florian Müllner
27c7512e4d core: Remove meta_core_change_workspace()
Unused since commit bf64e719a1 (2001!) ...
2015-07-23 12:13:45 +02:00
Rui Matos
7e1c6ff2a2 screen: On monitors-changed, update the window monitor before resizing
Since commit 14b0a83f64 we store the
main window monitor instead of computing it every time. This means
that we must now ensure that it's updated before trying to use it
which we do from meta_screen_resize_func() or else we'll crash on an
assertion later on when removing a monitor:

assertion failed: (which_monitor < workspace->screen->n_monitor_infos)

https://bugzilla.gnome.org/show_bug.cgi?id=752674
2015-07-21 16:46:09 +02:00
Carlos Garnacho
e648f2c244 events: Ensure touchpad gesture events go through clutter
They otherwise fall through paths that enable bypass_clutter, this
is necessary so they can be picked by captured-event handlers
along the actor hierarchy.

https://bugzilla.gnome.org/show_bug.cgi?id=752248
2015-07-20 22:01:05 +02:00
Jonas Ådahl
f6c9261bf6 wayland: Scale window geometry rects given the main output
Since we scale surface actors given what main output their toplevel
window is on, also scale the window geometry coordinates and sizes
(window->rect size and window->custom_frame_extents.top/left) in order
to make the window geometry represent what is being rendered on the
stage.

https://bugzilla.gnome.org/show_bug.cgi?id=744934
2015-07-16 11:54:14 +08:00
Jonas Ådahl
14b0a83f64 Don't calculate the main window monitor every time it`s needed
The main monitor of a window is maintained as 'window->monitor' and is
updated when the window is resized or moved. Lets avoid calculating it
every time it`s needed.

https://bugzilla.gnome.org/show_bug.cgi?id=744934
2015-07-16 11:54:14 +08:00
Jasper St. Pierre
4d3419607a window: Don't reference a dead function
meta_window_move_resize has been gone for a while now.
2015-07-06 00:52:49 -07:00
Jasper St. Pierre
9f04c58ffe Implement a generic "size change" mechanism
A much less hacky version of maximize / unmaximize is reimplemented
in terms of this, but it could also eventually be used for fullscreen /
unfullscreen, and tile / untile.
2015-07-05 23:03:36 -07:00
Jasper St. Pierre
8979e52a6c Install enum types 2015-07-05 22:01:59 -07:00
Jasper St. Pierre
1ea8efdeda stack: Don't prefer windows in the same group as not_this_one
The only time we ever execute this code is when we're minimizing or
hiding a window, in which case we should respect stacking order.

This fixes weird "bugs" where windows from the same app magically pop up
over other windows.
2015-07-05 14:33:08 -07:00
Jasper St. Pierre
a3fbbaabe8 delete: Remove old code
It doesn't compile
2015-07-05 14:29:56 -07:00
Jasper St. Pierre
91b7dedf36 Remove the ability to grab resize unmaximize
This is an extremely niche feature, and conflicts with the rest of our
interface being consistent about not allowing resizing while tiled or
maximized.
2015-07-01 16:27:19 -07:00
Florian Müllner
6c05eb583e stack: Don't try to focus hidden windows
A window may be hidden even if not minimized itself, for instance
when an ancestor is minimized. As meta_window_focus() will refuse
to actually focus the window in that case, don't pick it in the first
place.

https://bugzilla.gnome.org/show_bug.cgi?id=751715
2015-06-30 15:06:56 +02:00
Jasper Lievisse Adriaanse
3fe281ada9 Prevent redefinition of MetaKeyCombo
Fixes bug 747326
2015-06-26 21:40:44 -07:00
Jasper St. Pierre
d74b0d5be8 window: Clear the frame borders before calculating the unfullscreen rect
Going from fullscreen to unfullscreen involves a frame border size, so
in order to properly interpret the saved rect size, we need to make sure
that the frame borders are fully up to date.
2015-06-23 17:05:27 -07:00
Ting-Wei Lan
6b82f61dba build: Fix non-wayland build
This fixes error introduced in 09120132ef.

https://bugzilla.gnome.org/show_bug.cgi?id=750552
2015-06-23 16:37:40 -07:00
Jasper St. Pierre
7f3ada7831 xprops: Some more cardinal-related hygiene 2015-06-23 15:32:07 -07:00
Jasper St. Pierre
92d6a69153 xprops: Fix more gulong / 64-bit fallout from the xcb port 2015-06-23 15:09:32 -07:00
Carlos Garnacho
09120132ef core: Refrain from showing wayland windows when we don't have a buffer yet
The "calc showing" operation is queued in a few places alongside MetaWindow
creation, we should be ignoring these until there is a buffer to show.

https://bugzilla.gnome.org/show_bug.cgi?id=750552
2015-06-16 20:35:25 +02:00
Jasper St. Pierre
4d80a4cc31 Use more g_autofoo throughout mutter 2015-05-29 17:18:35 -07:00
Rui Matos
b39c00f344 window: Fix meta_window_set_alive() not working if first ping fails
window->is_alive isn't initialized explicitly so it defaults to FALSE
meaning that if the first ping fails we'd short circuit and not show
the delete dialog as we should.

We could initialize the variable to TRUE but in fact we don't even
need the variable at all since our dialog management is enough to
manage all the state we need, i.e. we're only interested in knowing
whether we're already displaying a delete dialog.

This does change our behavior here since previously we wouldn't
display the dialog again if the next ping failed after the dialog is
dismissed but this was arguably a bug too since in that case there
wouldn't be a way to kill the window after waiting for a while and the
window kept being unresponsive.

https://bugzilla.gnome.org/show_bug.cgi?id=749711
2015-05-22 16:53:42 +02:00
Rui Matos
d478d8f143 core/events: Invalidate monitor cache when we're a wayland compositor
When running as an X11 compositor we do this for every event we see on
the X event stream. As a wayland compositor we don't go through that
code path but since we see all events we can easily do this on motion
events.

In fact, we don't even need this caching when we're a wayland
compositor since we can always find where the pointer is without a
round trip but we're sharing the current monitor logic with the X
path so let's keep it as is for now.

https://bugzilla.gnome.org/show_bug.cgi?id=748478
2015-04-30 14:01:23 +02:00
Jasper St. Pierre
0de3869656 core: Remove unused function 2015-04-27 18:14:15 -07:00
Jasper St. Pierre
9f13033f15 window-wayland.[ch] => meta-window-wayland.[ch]
This finishes off the meta- prefix for wayland/.
2015-04-27 18:09:16 -07:00
Jasper St. Pierre
ca6e799b97 Move atomnames.h to x11/
This should *not* be part of the public API.
2015-04-27 16:36:56 -07:00
Rui Matos
d62c595e51 events: Ignore some event types when reseting idle time
These events don't result from actual hardware events so we shouldn't
use them to reset idle time.

https://bugzilla.gnome.org/show_bug.cgi?id=748541
2015-04-27 19:44:58 +02:00
Florian Müllner
2e3086e2aa screen: Add public method to get neighboring monitor
The existing private get_monitor_neighbor() function returns a
MetaMonitorInfo, which is private as well. Add a public wrapper
that returns a monitor index instead, as we do for other public
monitor-related methods.

https://bugzilla.gnome.org/show_bug.cgi?id=633994
2015-04-14 23:13:19 +02:00
Jasper St. Pierre
f3fecd478d frame: Always use the client window's visual for our frame
Since the frame is the window that's redirected, there's no reason for
it to match the root window. There *is*, however, a big incentive to
match the window's visual, since not doing so might trigger automatic
redirection.

On a specific platform, we construct a depth-32 root window, and stick a
depth-24 child window inside it. The frame ends up being created
depth-32, not depth-24, so we get automatic redirection.
2015-04-01 15:02:20 -07:00
Ray Strode
9f17c05a15 wayland: manually activate/deactivate stage when taking/dropping grab
clutter currently never emits activated or deactivated signals on
the stage object when using the EGL backend. Since the stage never
gets activated, accessibility tools, like orca, don't work.

This commit makes mutter take on the responsibility, by tracking
when the stage gains/loses focus, and then synthesizing stage
CLUTTER_STAGE_STATE_ACTIVATED state events.

A limitation of this approach is that clutter's own notion of
the stage activeness won't reflect mutter's notion of the
stage activeness.  This isn't a problem, in practice, and can
be addressed in the medium-term after making changes to
clutter.

https://bugzilla.gnome.org/show_bug.cgi?id=746670
2015-03-28 11:20:48 -04:00
Giovanni Campagna
a13f906ed1 prefs: connect to changed:: before reading the value of a setting
Otherwise glib might skip registering to change notifications

https://bugzilla.gnome.org/show_bug.cgi?id=746509
2015-03-27 13:15:30 -07:00
Jasper St. Pierre
4fc684b2ed window: Don't use C++-style comments 2015-03-14 16:03:44 -07:00
Carlos Garnacho
d63b9a1797 core: Unset all input events on the GDK connection
With all input events being handled through clutter, this only confuses
things, and most nominally, coerces touch events through places we didn't
intend to, like the window frame.

This makes again all touch events only handled in the passive grab on X11,
while the rest stays pointer (emulated) only.

https://bugzilla.gnome.org/show_bug.cgi?id=745335
2015-03-14 16:03:44 -07:00
Carlos Garnacho
a30ca3e62f core: Update cursor visibility on display events
https://bugzilla.gnome.org/show_bug.cgi?id=712775
2015-03-13 21:01:11 +01:00
Jasper St. Pierre
0bc6cb2aeb window: Remove the legacy get_outer_rect
It's unused in gnome-shell, and we don't care about compatibility in the
API. Don't expose it.
2015-03-08 20:38:30 -07:00
Jonas Ådahl
fffb863f37 wayland: Sync surface actor state when changing main monitor
In order to switch to the correct surface actor scale given the monitor
the surface is on, without relying on the client committing a new state
given some other side effect, sync the surface actor state when the main
monitor associated with the corresponding window changed.

https://bugzilla.gnome.org/show_bug.cgi?id=744933
2015-03-03 14:53:15 -05:00
Ray Strode
96b202c80d wayland: add keybindings for VT8-VT12
We currently only support switching to 1-7.
This commit brings us parity with X, and let's
us switch to all 12.

https://bugzilla.gnome.org/show_bug.cgi?id=744800
2015-02-19 16:42:58 -05:00
Jasper St. Pierre
0ac2f61a2c screen: Don't map the COW on Wayland
This is unnecessary, and since we don't shape it, we get a giant input
window covering the rest of our windows.
2015-02-18 12:42:32 -08:00
Rui Matos
3f2d658f20 monitor-manager: Expose MetaMonitorManager to introspection
This just exposes the type and the singleton getter necessary to make
it available to introspection. We'll expose more functionality as it
becomes needed.

https://bugzilla.gnome.org/show_bug.cgi?id=743745
2015-01-30 13:13:49 -05:00
Jasper St. Pierre
05353c1f7e frame: Don't redraw immediately when we resize
We're locked to frame sync anyway, so it doesn't make sense to try to
redraw early. In casual testing, this seems to actually make things
faster, as well.
2015-01-30 13:13:49 -05:00
Florian Müllner
a2ff8f4e1e stack: Fix a leak 2015-01-21 14:52:55 +01:00
Rui Matos
764c3dd137 display: Fix moving grab op check
We were regarding META_GRAB_OP_KEYBOARD_RESIZING_UNKNOWN as a move.

https://bugzilla.gnome.org/show_bug.cgi?id=743254
2015-01-20 17:49:27 +01:00
Jasper St. Pierre
d561b3b18f frames: Clutterify frame event handling
This lets us remove our horrible X11-based, GDK-based hacky frame event
handling in favor of a more sane one in Clutter.
2015-01-19 21:56:08 -08:00
Florian Müllner
b91461ee39 place: Fix workspace check when collecting relevant windows
When looking for space to place a new window, other non-minimized
windows on the same workspace should be taken into account. However
the current check does not work correctly when the placed window is
located on all workspaces, so handle that case explicitly.

https://bugzilla.gnome.org/show_bug.cgi?id=743217
2015-01-20 00:00:32 +01:00
Jonas Ådahl
db384a656c backends/native: Implement support for pointer barriers
When running as a dispay server pointer barriers are a server side
feature and requires no client interaction of any sort. This patch
implements pointer barriers that can be used when running as a display
server on the native backend. Running as a display server using the X11
backend is currently not supported.

https://bugzilla.gnome.org/show_bug.cgi?id=706655
2015-01-19 02:27:59 -08:00
Jasper St. Pierre
5c66bee84b display: Remove ungrab_should_not_cause_focus_window
It's been unused ever since we removed tabpopup.c
2015-01-17 17:55:36 -08:00
Jonas Ådahl
5f91a62f6f barriers: Separate implementation from public API
This patch removes the X11 specific code from MetaBarrier and creates an
abstraction layer MetaBarrierImpl. The existing X11 implementation is
moved to a new GObject MetaBarrierImplX11 implementing the abstract
interface MetaBarrierImpl which is instantiated by MetaBarrier when
supported.

While at it, move it to backends/ and properly name the files.

https://bugzilla.gnome.org/show_bug.cgi?id=706655
2015-01-17 17:22:57 -08:00
Jonas Ådahl
152b2dab59 barrier: Make X related hook more clearly named
https://bugzilla.gnome.org/show_bug.cgi?id=706655
2015-01-17 17:22:56 -08:00
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
5c60ea6635 keybindings: Consistently use slice allocation for MetaKeyBinding 2015-01-09 14:15:17 -08:00
Jasper St. Pierre
9abcf424b8 prefs: Remove per_window flag from MetaKeyPref
It's unused.
2015-01-09 14:15:17 -08:00
Jasper St. Pierre
cc7af83f8a prefs: Correct the MetaPreference value for workspace names 2015-01-09 14:15:17 -08:00
Jasper St. Pierre
a1d8110221 keybindings: Merge rebuild_binding_index into reload_combos
The two are always called at the same time.
2015-01-08 14:36:47 -08:00
Jasper St. Pierre
9d6357f05a keybindings: Rename MetaKeyDevirtCombo to MetaResolvedKeyCombo
rtcm thought this was less awkward of a name.
2015-01-08 14:36:47 -08:00
Jasper St. Pierre
5bc2bcd109 keybindings: Simplify our keycode/mask pairs with MetaKeyDevirtCombo 2015-01-06 19:24:29 -08:00
Jasper St. Pierre
d12390002a keybindings: Have meta_change_keygrab take a MetaKeyDevirtCombo 2015-01-06 19:13:03 -08:00
Jasper St. Pierre
13acf9e35d keybindings: Have meta_accelerator_parse take a MetaKeyCombo 2015-01-06 19:11:57 -08:00
Jasper St. Pierre
3beb187cac keybindings: Split the resolved keybinding out from MetaKeyCombo
MetaKeyCombo is about the *unresolved* keybinding, which can either be a
"keysym" (<Ctrl>F) or a "keycode" (<Ctrl>0x21). When we resolved the
keysym to a keycode, we stuffed it back in the same MetaKeyCombo, which
confused about what the "keycode" field was for. Thus, we often stomped
on the user's explicit choice if they chose a keycode binding value.

To solve this, create a separate structure, the "devirtualized key combo"
or MetaKeyDevirtCombo, which contains a resolved keycode from the
keysym, and a devirtualized modifier mask. The MetaKeyCombo is now
always a "source" value, and the MetaKeyDevirtCombo is now always what
the user chose.

This also lets us significantly clean up the overlay and ISO key binding
paths.
2015-01-06 19:03:11 -08:00
Jasper St. Pierre
a3b8dcbd04 keybindings: Apply the same fix for keycodes to the GrabAccelerator API 2015-01-06 18:50:30 -08:00
Jasper St. Pierre
3ff8b0051d keybindings: Allow using keycodes directly for overlay-key
The reason MetaKeyCombo has a keycode value at all is *not* to store the
devirtualized keycode from the keysym, but instead to allow people that
type in "0x55" into the preference. Everything except the overlay-key
respected this. Make the overlay-key binding respect this.
2015-01-06 18:50:30 -08:00
Jasper St. Pierre
a8bf7934fb keybindings: Use one path to reload binding combos
Rather than one for modifiers and one for keycodes.
2015-01-06 18:50:29 -08:00
Jasper St. Pierre
7159845c6e keybindings: Embed MetaKeyCombo into MetaKeyGrab directly
A simple cleanup
2015-01-06 18:46:35 -08:00
Jasper St. Pierre
7bccd4f22f prefs: Don't parse modifiers for the overlay-key
We don't actually accept modifiers for the overlay key.
2015-01-06 18:46:32 -08:00
Jasper St. Pierre
e4e00b383e keybindings: Remove keysym argument from meta_change_keygrab
It's only used for a debug statement.
2015-01-06 18:46:24 -08:00
Jasper St. Pierre
36454542ae prefs: Fix minor code style issues 2015-01-06 17:58:42 -08:00
Jasper St. Pierre
34fbca0181 frames: Remove the easy one-liner meta_core_* wrappers 2015-01-01 12:02:53 -08:00
Jasper St. Pierre
4496fb4447 frames: Remove all other uses of meta_core_get
RIP.
2015-01-01 11:56:14 -08:00
Jasper St. Pierre
7e66d2a484 frames: Punch down META_CORE_GET_FRAME_FLAGS / TYPE
These can be fetched directly off of the MetaWindow.
2015-01-01 11:48:55 -08:00
Jasper St. Pierre
12135afa5e frames: Give Havoc and Owen a heart attack
Break down the beautiful core/ui abstraction barrier by inserting
a pointer to MetaWindow into a MetaUIFrame. I'm a scoundrel, I know.
We'll use this very soon to destroy meta_core_get.
2015-01-01 11:42:25 -08:00
Jasper St. Pierre
dcce4e64bc frames: We don't need to pass in the frame rect to get_bounds either
The MetaFrameGeometry already has this information.
2015-01-01 11:42:13 -08:00
Jasper St. Pierre
4d3511649b frames: Don't pass the frame rect into get_mask
We can query it directly.
2015-01-01 11:19:35 -08:00
Jasper St. Pierre
f303ec2eaa core: Remove META_CORE_GET_FRAME_WIDTH / HEIGHT from documentation
It messes up my autocomplete.
2015-01-01 09:23:03 -08:00
Jasper St. Pierre
8fdbae192a frame: Start converting over to direct usage of MetaUIFrame 2014-12-31 22:44:20 -08:00
Jasper St. Pierre
2413e672c8 frame: Put a MetaUIFrame* in our MetaFrame
This is a small start, but it lets us start to clean up this
UI split mess.
2014-12-31 22:43:00 -08: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
23681800d9 frame: Remove extra argument from sync_to_window 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
dcc4ce4ff4 core: Remove META_CORE_GET_ICON
It's unused.
2014-12-31 20:06:17 -08:00
Jasper St. Pierre
2dd1f37820 Move the resizepopup to a compositor-side feature
This is the last big feature that requires X11 on Wayland, so let's just
trash it and make GNOME Shell reimplement it.
2014-12-29 17:44:41 -08:00
Florian Müllner
5e9db422c9 Remove all support for the metacity format
Rest in peace you magnificent format, love-child of arcane X11 drawing
API and markup craze, you will not be missed.
We do remember however the bravery of a many men and women, who fearlessly
descended into the guts of your intrinsics and turned ugliness into beauty;
their work will still be spoken of when you will long have been forgotten.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
2014-12-29 08:46:37 -08:00
Florian Müllner
662dd6a289 theme: Use a singleton theme
Different themes don't make sense when we are always using the current
GTK+ theme for everything, so adapt the MetaTheme API to use a singleton.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
2014-12-29 08:46:37 -08:00
Florian Müllner
26c4c21e13 Properly update on GTK+ theme changes
With geometry information picked up from GTK+, we need to queue a
resize on GTK+ theme changes to correctly update to the new geometry.

https://bugzilla.gnome.org/show_bug.cgi?id=741917
2014-12-29 08:46:36 -08:00
Rico Tzschichholz
ab6c4c82f6 screen: Use meta_fatal to fx build
Fixing 5ad15bb5e5
2014-12-29 09:46:19 +01:00
Jasper St. Pierre
93b7137c62 Allow raise_on_click to be set independent of focus_mode
Based on a patch by Thomas Jaeger <ThJaeger@gmail.com>
2014-12-28 22:36:27 -08:00
Jasper St. Pierre
5ad15bb5e5 screen: Crash when we can't load a cursor
To make it easier for users to understand why their cursor disappeared.
2014-12-28 22:13:44 -08:00
Jasper St. Pierre
cd4206764e Remove a few more guards for frees 2014-12-28 19:51:22 -08:00
Jasper St. Pierre
55df99447a window-private: Remove duplicate definition
We already publicly expose meta_window_change_workspace, but it's still
listed in window-private.h. Remove the duplicate definition.
2014-12-28 19:36:35 -08:00
Jasper St. Pierre
d45080d32e screen: Fix build
Forgot to squash again...
2014-12-28 19:36:29 -08:00
Jasper St. Pierre
fa97364fa8 screen: Behave better about CM selections 2014-12-28 19:20:00 -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
6492845f27 display: Unknown keyboard resize ops are resizing ops
This fixes the resize popup not showing up when doing a keyboard
resize.
2014-12-01 08:31:49 -08:00
Jasper St. Pierre
a2b2a7a26f display: Call grab_op_ended after actually ending the grab op
Otherwise, we'll still think we're resizing the window when we
send out the configure, causing apps that care about that to get
stuck in that state.
2014-11-26 15:43:32 -08:00
Ray Strode
7ecde19aee Revert "screen: Set a black background for testing purposes"
This reverts commit ec8ed1dbb0.

1) It turns out to add a momentary flicker from the transition
between the login screen and user session
2) It actually isn't needed anymore since bug 733026

https://bugzilla.gnome.org/show_bug.cgi?id=740377
2014-11-20 14:44:21 -05: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
cb66ab5a87 constraints: Fix up aspect ratio math for frame rect conversion 2014-11-10 15:49:06 -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
df384965c3 core: Unset "pointer emulating" sequence after event processing
The set/unset branches of meta_display_update_pointer_emulating_sequence()
have been split and put directly where it makes sense. The pointer emulated
sequence will be updated before processing the CLUTTER_TOUCH_BEGIN, and
after processing the CLUTTER_TOUCH_END, this way the checks on this hold
true during all the sequence lifetime.

https://bugzilla.gnome.org/show_bug.cgi?id=738411
2014-10-23 17:16:59 +02: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
Jasper St. Pierre
34516aeab6 display: Fix accidental inversion from 2f9c601
Commit 2f9c601 accidentally changed the logic here, changing the grab
behavior when not using raise-on-click. Fix this.

Spotted-by: Adam Goode <adam@spicenitz.org>
2014-10-14 22:20:33 -07:00
Jasper St. Pierre
64295e8cd7 keybindings: Always freeze on the stage window
This is what gnome-shell does, so there's no reason to include this as
part of our API.
2014-10-14 14:36:47 -07:00
Florian Müllner
a460f88b31 Remove unused variable 2014-10-14 21:49:47 +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
Tom Beckmann
d07e2f4090 workspace: fix crash when creating a new workspace with sticky windows that have struts
The constructor would collect windows that are sticky before initializing its state
which would lead to a crash in the case of windows with struts which trigger a work
area recalculation where mutter would assume, due to uninitialized state, that an
existing work area has to be freed.

https://bugzilla.gnome.org/show_bug.cgi?id=738384
2014-10-12 22:27:02 +02:00
Rico Tzschichholz
2deea6e0a3 events: Fix build without wayland
https://bugzilla.gnome.org/show_bug.cgi?id=738225
2014-10-09 20:03:30 +02:00
Florian Müllner
c0bdb3018b display: Do not include unmanaging windows in list_windows()
There's a small window before a window that is being unmanaged is
unregistered with the display. The MetaScreen::window-left-monitor
and MetaWorkspace::window-removed emissions fall right into that
window, so code that runs in that time may well be out of our
control; we can make sure that the method it can use to get an
updated list of windows no longer contains the destroyed window
though, which is a much better option than expecting everyone to
filter the list themselves.
2014-10-07 20:09:09 +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