Commit Graph

976 Commits

Author SHA1 Message Date
Jasper St. Pierre
644f3e1275 window: Make setters for shape/input/opaque regions private again
Wayland now pushes these to the surface actor rather than the toplevel
MetaWindow...
2013-11-25 17:25:56 -05:00
Jasper St. Pierre
eec0f5df47 display: Fix logic for determining whether our focus was successful
In some cases, we can focus the frame window instead of the client
window, so make sure that our checks include that as well.

https://bugzilla.gnome.org/show_bug.cgi?id=715030
2013-11-25 15:14:18 -05:00
Rui Matos
ba3968a822 keybindings: Fix typo in port to Clutter events
We always want to trigger on key press.
2013-11-25 14:15:28 +01:00
Jasper St. Pierre
6d639ac528 window: Support pinging Wayland surfaces as well 2013-11-21 14:24:04 -05:00
Jasper St. Pierre
aa3643cdde Move window pings to MetaWindow
This will make it possible to use on Wayland as well...
2013-11-21 14:24:04 -05:00
Rui Matos
5ea443eb4b idle-monitor: Fix a GSList leak
https://bugzilla.gnome.org/show_bug.cgi?id=712833
2013-11-21 19:22:25 +01:00
Jasper St. Pierre
6c0e16c482 keybindings: Properly interpret keybindings
We need to compare against the keysym, not the keycode.
2013-11-21 13:09:21 -05:00
Jasper St. Pierre
153d8efcf5 window: Create a backing MetaWindow for unmapped Wayland surfaces
We require a MetaWindow to properly implement some of the requests
for xdg_surface, so add a way to have an unmapped MetaWindow that
we can store properties on, that we later map when the client
attaches a buffer...
2013-11-19 17:48:19 -05:00
Jasper St. Pierre
0824eb7c96 cursor-tracker: Make sure to sync after we change the cursor
So the cursor changes immediately...
2013-11-19 15:43:46 -05:00
Jasper St. Pierre
d945501be6 window: Remove width/height from meta_window_new_for_wayland 2013-11-19 15:37:33 -05:00
Jasper St. Pierre
ca342c4573 window: Remove unused parameter from meta_window_new_shared() 2013-11-19 15:37:33 -05:00
Florian Müllner
3025cb7c48 display: Remove unused variables 2013-11-19 20:12:51 +01:00
Florian Müllner
17f48baf3a display: Tweak code to work around a compiler warning
The compiler is not quite smart enough to figure out that the condition
for setting the "compositor" variable matches a later condition for
accessing it, so express this in a way the compiler will understand.
2013-11-19 20:08:46 +01:00
Florian Müllner
333661a9d8 stack: Drop unused code
Since commit 2b2b2d3191 the code is unused and triggers a
compiler error with -Werror=unused-but-set-variable.
2013-11-19 20:08:46 +01:00
Owen W. Taylor
b9da43b753 Rename meta_window_get_outer_rect() to meta_window_get_frame_rect()
For clarity, rename meta_window_get_outer_rect() to match terminology
we use elsewhere. The old function is left as a deprecated
compatibility wrapper.
2013-11-19 14:04:16 -05:00
Owen W. Taylor
097ee776c7 Stop passing around MetaFrameBorders
Instead of passing around MetaFrameBorders, compute it when we need it.
This also allows us to know that we are using MetaFrameBorders only for windows
with frames (where it is meaningful) and not for frameless windows, which
can have custom borders which we need to interpret differently.

https://bugzilla.gnome.org/show_bug.cgi?id=707194
2013-11-19 14:04:16 -05:00
Owen W. Taylor
a4a8f1f863 MetaFrame: Cache borders
Cache the computed border size so we can fetch the border size at
any time without worrying that we'll be spending too much time in
the theme code (in some cases we might allocate a PangoFontDescription
or do other significant work.)

The main effort here is clearing the cache when various bits of window
state change that could potentially affect the computed borders.

https://bugzilla.gnome.org/show_bug.cgi?id=707194
2013-11-19 14:04:16 -05:00
Owen W. Taylor
f36a627330 Use utility functions to convert between frame and client rectangles
There are extensive places in the code where we convert between the client
rectangle and the frame rectangle. Instead of manually doing it use
new helper functions on MetaWindow and the existing meta_window_get_outer_rect().

This fixes a number of bugs where the computation was being done incorrectly,
most of these bugs are with the recently added custom frame extents, but
some relate to invisible borders or even simply to confusion between the
window and frame rectangle.

Switch the placement code to place the frame rectangle rather
than the client window - this simplifies things considerably.

https://bugzilla.gnome.org/show_bug.cgi?id=707194
2013-11-19 14:04:16 -05:00
Giovanni Campagna
a1087c3f30 constraints: account for decorations when positioning modal dialogs
What we want to achieve is that the dialog is visually centered
on the parent, including the decorations for both, and making sure
that CSD/frame_extents are respected.

https://bugzilla.gnome.org/show_bug.cgi?id=707194
2013-11-19 14:04:16 -05:00
Jasper St. Pierre
aad275b9a2 window: Fix signedness warning 2013-11-19 14:03:09 -05:00
Jasper St. Pierre
f0397eab94 keybindings: Fix warning
keybinding handlers now take a ClutterEvent, not an XIDeviceEvent
2013-11-19 14:02:42 -05:00
Lionel Landwerlin
6867d44573 window: don't ignore resize button release event for move/resize actions
https://bugzilla.gnome.org/show_bug.cgi?id=710251
2013-11-19 13:55:17 -05:00
Jasper St. Pierre
a841fff2ac screen: Laters are not GSources
This warns with the new GLib when we destroy the screen.

https://bugzilla.gnome.org/show_bug.cgi?id=711731
2013-11-19 13:52:56 -05:00
Marc-André Lureau
957513242c xrandr: use "hotplug_mode_update" property
Use the "hotplug_mode_update" connector property indicating that the
screen settings should be updated: get a new preferred mode on hotplug
events to handle dynamic guest resizing (where you resize the host
window and the guest resizes with it).

https://bugzilla.gnome.org/show_bug.cgi?id=711216
2013-11-19 13:50:15 -05:00
Sindhu S
e91268a250 Add keyboard shortcut for Always on Top, bug 704831 2013-11-19 13:48:35 -05:00
Jasper St. Pierre
82cb4e8267 display: Don't focus the no-focus-window when sending WM_TAKE_FOCUS to a globally active window
Clients like on-screen keyboards try not to take focus when the user clicks
on their window by setting the Input hint to false. However, due to GTK+ and
GDK bugs, the public API for setting the Input hint to false don't remove
WM_TAKE_FOCUS from WM_PROTOCOLS, unintentionally putting them into Globally
Active mode.

These clients also expect that since they don't want to take focus, they want
the focus to remain on the existing window. In this case, for clients like
on-screen keyboards, it's so they can send synthesized keyboard events to the
focused window.

https://bugzilla.gnome.org/show_bug.cgi?id=710296
2013-11-19 13:46:34 -05:00
Jasper St. Pierre
2b2b2d3191 stack: Don't take a weak pointer
Since this is stored in an array full of data that will be copied
around, we can't rely on pointer addresses for every item in a stack
not changing.

I don't see any reason that we even have a weak pointer, either.
This code looks safe to me without it.
2013-11-19 13:10:45 -05:00
Jasper St. Pierre
bbbb9ac53c display: Make handle_[x]event private 2013-11-18 21:19:00 -05:00
Jasper St. Pierre
73a9082062 cursor-tracker: Make ensure_wayland_cursor take a ref
This fixes a crash in the last commit because that's what I thought
this would do.

It also simplifies callers drastically...
2013-11-18 19:47:34 -05:00
Jasper St. Pierre
4091f5493d cursor-tracker: Force the grab cursor on grab ops
This makes window moving have a 'window move' cursor, and similar.
2013-11-18 19:34:24 -05:00
Jasper St. Pierre
d96b053c9d cursor-tracker: Use a sync methodology for the cursor image
Rather than have MetaWaylandSeat do all the state management itself,
put the split between the root cursor and the window cursor in the
cursor tracker itself. We'll expand this to add a "grab" cursor in
the next commit, allowing us to force a cursor on grab operations.
2013-11-18 19:25:47 -05:00
Jasper St. Pierre
1f569bef76 Fix dragging on move/resize grabs
We need to use the grab_window for incoming events if we have an active grab.
2013-11-18 18:38:24 -05:00
Jasper St. Pierre
3c7cd1f38c wayland-surface: Use begin_grab_op for move grabs 2013-11-14 21:34:20 -05:00
Jasper St. Pierre
cf181fe109 display: Adapt to new clutter event filter API 2013-11-14 14:34:53 -05:00
Rui Matos
63b9110f93 wayland: Update internal wayland state unconditionally
Things like idle times and the cursor position need to be updated even
if there's a mutter grab in effect.

https://bugzilla.gnome.org/show_bug.cgi?id=712247
2013-11-13 21:55:05 +01:00
Rui Matos
ae44bff0b1 display: Without a grab op let events go through clutter too
We want events to reach clutter no only when there a compositor modal
grab but also when no grab op is in effect.

https://bugzilla.gnome.org/show_bug.cgi?id=712247
2013-11-13 21:55:04 +01:00
Jasper St. Pierre
23ba3e527f wayland: Support alternative focus modes like focus-follows-mouse
Use the existing code for MetaWindow focus-follows-mouse to support this.
2013-11-12 16:53:15 -05:00
Jasper St. Pierre
08df9bf559 display: Use MetaWindow for auto-raise callbacks
This allows us to autoraise Wayland windows... well, except for the
XQueryPointer, but we'll replace that soon.
2013-11-12 16:53:15 -05:00
Jasper St. Pierre
648639fffe display: Invoke Wayland from the Grand Central Station callback 2013-11-12 16:53:15 -05:00
Jasper St. Pierre
875bbec949 wayland: Drop old hack to synthesize motion events
mutter now uses Clutter events for the source of its drag support, so
we don't need to synthesize X11 events anymore.
2013-11-12 16:53:14 -05:00
Jasper St. Pierre
666e5f1f98 keybindings: Port to Clutter 2013-11-12 16:53:14 -05:00
Jasper St. Pierre
e86c53230f display: Move the pointer event handling code to work in terms of Clutter events
There is now a meta_display_handle_event alongside the
meta_display_handle_xevent function which handles events in terms of
Clutter events instead of X events. A Clutter event filter is
registered so that all Clutter events will pass through this function.
The pointer event handling code from the X event version has been moved
into this new function and has been modified to use the details from
the Clutter event instead of the X event. This is a step towards
moving all of the event handling code over to use Clutter events.

Based-heavily-on-a-patch-by: Neil Roberts <neil@linux.intel.com>
2013-11-12 16:53:14 -05:00
Jasper St. Pierre
4ea4658abf display: Split out other event handling as well
This vastly simplifies the code in event_callback and allows us to potentially
take more of this logic and punt it to Wayland-specific backends.
2013-11-12 16:53:14 -05:00
Jasper St. Pierre
58f6ab0a27 display: Split out input event handling
This helps with git's diff code by moving all the giant indentation
changes, letting us know what's going on better when we move to
Clutter for event handling.
2013-11-12 16:53:14 -05:00
Jasper St. Pierre
9c0cc664d1 display: Rename filter_out_event to bypass_gtk
This clarifies the intent of the variable and makes it match bypass_compositor
2013-11-12 16:53:14 -05:00
Jasper St. Pierre
84d26e31f1 display: Move barrier event processing to barrier.c
This puts all the code that's easily ported to Clutter events in one giant
switch statement, as Clutter doesn't translate barrier events.
2013-11-12 16:53:14 -05:00
Jasper St. Pierre
64a848fcb7 display: Add a quick out path to handle_xevent
This makes the code flow more like the scheme we usually use, and allows
us to flatten out the method somewhat.
2013-11-12 16:53:14 -05:00
Neil Roberts
429583ae8b display: Rename meta_display_handle_event to meta_display_handle_xevent
The plan is to make a new version of meta_display_handle_event that
will accept Clutter events instead of X events and then gradually move
over the events to the new function and finally remove the X version.
2013-11-12 16:53:14 -05:00
Giovanni Campagna
93ae868987 wayland: sync the keymap from X to wayland
When X clients change the keyboard map, the also update a property
on the root window. We can notice that and rebuild our data structures
with the new values, as well as inform the wayland clients.

This is a terrible hack, and it's not how we want to implement things
in 3.12, but it's enough to have the same keyboard layout in the
shell, in X clients and in wayland clients in 3.10, until we decide
on the fate of the keyboard g-s-d plugin.

https://bugzilla.gnome.org/show_bug.cgi?id=707446
2013-11-12 16:53:13 -05:00
Jasper St. Pierre
7186841db0 wayland-surface: Remove initial_state
Just put everything in the double buffered state so it all
arrives at the same time; on commit.
2013-11-12 16:53:13 -05:00