1
0
Fork 0
Commit graph

4743 commits

Author SHA1 Message Date
Rui Matos
bf9fdf448d wayland-keyboard: Make update_pressed_keys() more generic
It will allow us to re-use this function next. Also rename the keys
array to pressed_keys since we'll need to add a different one.

https://bugzilla.gnome.org/show_bug.cgi?id=727178
2014-08-05 18:11:53 +02:00
Jasper St. Pierre
63c627ec18 wayland: Add a few statics we forgot before 2014-08-04 10:28:44 -04:00
Jasper St. Pierre
dadbd793be wayland: Fix naming scheme for request handlers
Our implementations should take the name of the request.
2014-08-04 10:27:26 -04:00
Jasper St. Pierre
75b6e917ad wayland: Simplify global version management
libwayland-server already checks the bounds of the bind for versioning,
meaning that the value that we pass to wl_global_create is all we need.
2014-08-04 10:25:23 -04:00
Jasper St. Pierre
ab53c0e943 wayland: Simplify slave version management
Slave objects should always be the same version as their parent
constructor, except for the generic wl_registry.bind.
2014-08-04 10:25:20 -04:00
Jasper St. Pierre
c2fe6a18ad shadow-factory: Comment fixes 2014-08-02 18:55:44 -04:00
Florian Müllner
b7119c55a6 window-props: Add FORCE_INIT flag to force hooks for unset properties
Since commit a7b7213017, we rely on the standard property
system to initialize the window type (and likewise for the window
role since commit 031154a400). However as property hooks are
never run for properties that are not set, we end up not initializing
the window type correctly for windows with no _NET_WM_WINDOW_TYPE
property (which includes virtually all OR windows, causing them to
show up in pagers and the Shell overview and resulting in frequent
crashes due to breaking reasonable assumptions all over the place).

Introduce a new FORCE_INIT flag to allow forcing hooks to run
even when the corresponding property is unset, and use it for
both _NET_WM_WINDOW_TYPE and _NET_WM_WINDOW_ROLE.
2014-08-02 20:26:00 +02:00
Giovanni Campagna
d0f2c6be6d ui: always set the frame background to None
This way the xserver never paints the frame background, even if
the client window is destroyed. This allows us to have clean
destroy window animation.

There is no problem with interactive resizing because applications
are using the XSync protocol, so we're not painting unless the
client has redrawn.

https://bugzilla.gnome.org/show_bug.cgi?id=734054
2014-07-31 17:54:38 +02:00
Jasper St. Pierre
f9a77aec3f shadow-factory: Fix style 2014-07-31 17:49:13 +02:00
Jasper St. Pierre
bee6d2b240 shadow-factory: Untabify 2014-07-31 17:49:13 +02:00
Jasper St. Pierre
9a6a189e36 window-actor: Rebuild the shape and mask when the surface updates
Connecting to size-changed is wrong -- size-changed tells us when
we *told* the X server or resize the window. For X11, we're sort of
guaranteed that the surface will be updated at some point before the
next frame, but for Xwayland, we can't be sure that the new surface is
attached at this point.

This fixes weird artifacts when resizing apps like xclock.
2014-07-31 17:49:13 +02:00
Jasper St. Pierre
505eabb78c surface-actor: Remove unused APIs 2014-07-31 17:49:13 +02:00
Giovanni Campagna
b0ba325f0e MetaShapedTexture: fix critical warnings with fully obscured windows
If a window is fully obscured, it could have a negative paint volume
width/height. Normalize that to 0x0.
2014-07-31 16:21:32 +02:00
Jasper St. Pierre
6fbd21001b window-actor: Base the paint volume on our children, not our shape
This was wrong for subsurfaces that extend beyond the parent's shape,
since the paint volume would be wrong in this case. Instead of using the
shape region which can be out of date and wrong, just use the union of
our children's volumes, which is a lot easier to manage.
2014-07-30 17:15:00 +02:00
Jasper St. Pierre
626e4965b1 shaped-texture: Remove silly ClutterPaintVolume code with slightly less silly ClutterActorBox code 2014-07-30 17:09:23 +02:00
Giovanni Campagna
e56f963574 MetaWaylandTouch: fix running without touch hardware
Refuse to create a touch resource if we don't have the capability
(for misbehaving clients), and don't attempt to use touch data
structures that are not initialized.
2014-07-30 15:46:19 +02:00
Jasper St. Pierre
65a8f9100c window-wayland: Only fizzle out configures when we do pending moves
This is a terrible hack. We need to figure out a better way to do
interactive resizes.

This fixes weird resizing from the left bugs when using GTK+, which is
really slow at acking configures.
2014-07-28 12:04:23 +02:00
Jasper St. Pierre
6954d23444 window-actor: Don't connect to allocation-changed
This can cause allocation loops. Connect to size-changed to update the
shape instead.
2014-07-28 11:32:52 +02:00
Jasper St. Pierre
6c624e1c26 window-wayland: Update the buffer rect size immediately 2014-07-28 11:30:15 +02:00
Jasper St. Pierre
cc839029b9 window: Don't leak the input region 2014-07-28 11:23:38 +02:00
Jasper St. Pierre
25f8eaf1ac shaped-texture: Clean up slightly 2014-07-28 11:23:36 +02:00
Jasper St. Pierre
8fdd226b8b wayland-surface: Fix coordinates for xdg_surface.show_window_menu 2014-07-28 10:22:50 +02:00
Jasper St. Pierre
6c5595fa9c window-wayland: Don't insist if the window gives us a bad buffer
This is an easy way to get into an infinite loop where we're constantly
re-sending stuff to the window. If it worked once, it probably won't
work again.
2014-07-27 18:38:56 +02:00
Jasper St. Pierre
e6558f838e window-wayland: Clean up code that pends moves 2014-07-27 18:09:12 +02:00
Jasper St. Pierre
57037a45b8 wayland-surface: Don't do pending move/resizes on all commits
We assume in meta_window_wayland_move_resize that the next commit that
changes the geometry will always be for our next pending operation, so
if we have a move pending on a resize, the next commit will trigger the
move. This is, of course, fundamentally wrong.

We broke this assumption even more now that we don't fizzle out calls to
meta_window_move_resize_internal and now call it on every commit, which
means that a simple damage and then commit would complete a pending
move.

This was even broken by apps like weston-terminal, which, when clicking
on the maximize button, first redraws the terminal with the maximize
button state back on hover on press, and would only redraw when it got
the configure event with the coordinates.

To track the correct commit to apply the move for, we implement the
ack_configure request and ignore all move/resizes that happen before
that.

Right now, we actually fizzle out the entire move/resize if there's a
future pending configure we're waiting on.
2014-07-27 18:09:12 +02:00
Jasper St. Pierre
c844611052 window-wayland: Rename saved_pos to pending_move
This is really what it is -- if we make the move/resize at the same time
as a move, we need to pend the move until the client submits the resize.
2014-07-27 18:09:12 +02:00
Jasper St. Pierre
b60e02956d wayland-surface: Add some extra protection
Make sure we're not configuring some sort of weird surface.
2014-07-27 18:09:12 +02:00
Jasper St. Pierre
4fe66ce0a9 prefs: Scale the root window cursor by the scale factor
This fixes small cursors on HiDPI displays.
2014-07-27 18:09:12 +02:00
Jasper St. Pierre
4b5a503cee backend-x11: Make sure to not crash during initialization
Sometimes we can get a host event without having the display up and
running yet. Just don't pass it to the compositor in that case, since it
won't be possible for it to have any event that matters.
2014-07-27 16:14:46 +02:00
Jasper St. Pierre
817995d97f wayland-surface: Make sure to zero out the geometry
Otherwise our implicit surface geometry calculation will be junk.
2014-07-27 15:23:00 +02:00
Jasper St. Pierre
0e7221c361 window: Clean up keyboard-resizing code path 2014-07-27 15:03:38 +02:00
Jasper St. Pierre
938fb8e6c8 cursor-tracker: Reindent 2014-07-27 07:54:06 -04:00
Cosimo Cecchi
cd84317346 compositor: add support for unminimize compositor effects
https://bugzilla.gnome.org/show_bug.cgi?id=733789
2014-07-26 17:26:40 +02:00
Jasper St. Pierre
4f55e16fe9 wayland-keyboard: Add support for the repeat_info event in Wayland v4 2014-07-25 09:25:01 -04:00
Jasper St. Pierre
c30ef668de events: Fix compilation when disabling the native backend 2014-07-24 14:54:38 -04:00
Carlos Garnacho
62e0c42803 events: Do not swallow touch events on windows
Those might eventually trigger a gesture into recognition.

https://bugzilla.gnome.org/show_bug.cgi?id=733631
2014-07-24 18:07:31 +02:00
Carlos Garnacho
70aee2d95e display: cancel wayland client touches when the compositor is grabbed
When a compositor grab begins, clients will stop receiving events, so any
ongoing sequence at that time must be cancelled.

https://bugzilla.gnome.org/show_bug.cgi?id=733631
2014-07-24 18:07:30 +02:00
Carlos Garnacho
63c7591698 events: Simplify gesture event management
MetaGestureTracker has been separating the "did I handle an event?" and the
"should the event be filtered out?" questions, merge this and make
handle_event() reply to "should the event be only handled by me?".

If a sequence wasn't accepted yet by the gesture tracker, the event will
go through (eg. not handled exclusively by the gesture tracker) and it'll
still be processed by Clutter, triggering gesture actions, and maybe
changing the sequence into other state.

https://bugzilla.gnome.org/show_bug.cgi?id=733631
2014-07-24 18:05:56 +02:00
Carlos Garnacho
930361b988 wayland: Handle window drags for touch events
The grabbing state is now checked for both pointer/touch devices
within the seat, and the grab start coordinates returned by
meta_wayland_seat_get_grab_info().

https://bugzilla.gnome.org/show_bug.cgi?id=733631
2014-07-24 18:05:56 +02:00
Carlos Garnacho
baadb75a5e wayland: Clear hashtable pointers on meta_wayland_touch_release()
Just in case they are poked while no touch interface is available;

https://bugzilla.gnome.org/show_bug.cgi?id=733631
2014-07-24 18:05:56 +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
41fdc4ac2e display: Add meta_display_is_pointer_emulating_sequence()
This function tells the obvious on X11, and implements a similar mechanism
on wayland to determine the "pointer emulating" sequence, or one to stick
with when implementing single-touch behavior.

https://bugzilla.gnome.org/show_bug.cgi?id=733631
2014-07-24 18:05:56 +02:00
Carlos Garnacho
177ec27cca gesture-tracker: Add meta_gesture_tracker_get_n_current_touches()
Due to the way the MetaGestureTracker processes every touch event, this
will tell as closely to Clutter as possible the current number of touches
happening on the stage.

Even though, this is subject to windowing behavior, on X11, rejected touches
will be soon followed by a XI_TouchEnd event, so the compositor will stop
seeing touch sequences that are still operating on clients. On wayland, touch
sequences are processed by the compositor during all their lifetime, so these
will stay on the MetaGestureTracker with META_SEQUENCE_PENDING_END state, yet
still tracked.

https://bugzilla.gnome.org/show_bug.cgi?id=733631
2014-07-24 18:05:56 +02:00
Adel Gadllah
37652ca2cf background: Do not assume GLSL is available
Some hardware does not support it causing crashes in cogl during paint.

https://bugzilla.gnome.org/show_bug.cgi?id=733623
2014-07-24 16:51:53 +02:00
Carlos Garnacho
6c22759d29 display: Add forgotten meta_display_cancel_touch 2014-07-23 18:37:51 -04:00
Carlos Garnacho
25b6a40ad4 display: Implement gesture-induced touch cancellation for wayland
On wayland, touches are initially both handled by the compositor and sent
to clients, proceeding to cancellation on clients only after the compositor
claims the sequence for itself. Implement the cancellation detail through
MetaGestureTracker::state-changed.

https://bugzilla.gnome.org/show_bug.cgi?id=733631
2014-07-24 00:17:04 +02:00
Carlos Garnacho
fbea59b326 wayland: set the current serial on touch down/up notifications
Do just like pointer button events, and do not bump the serial, so serials
match on window drag/move requests triggered from touch events.

https://bugzilla.gnome.org/show_bug.cgi?id=733631
2014-07-24 00:16:23 +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
Carlos Garnacho
029d69919b wayland: Rename touch_handle_cancel_event() to meta_wayland_touch_cancel()
This will serve as a generic call to issue touch cancellation on clients,
useful for the gesture tracker support.

https://bugzilla.gnome.org/show_bug.cgi?id=733631
2014-07-24 00:14:03 +02:00
Carlos Garnacho
5e395fb676 wayland: Fix infinite loop in touch_handle_cancel_event()
https://bugzilla.gnome.org/show_bug.cgi?id=733631
2014-07-24 00:13:26 +02:00
Carlos Garnacho
ac448bd42b seat: Listen for ClutterDeviceManager signals in order to update capabilities
The capability flags are determined from the device types of the slave devices
that are currently attached. This also happens whenever a device is added or
removed, so the capabilities are kept up to date, and clients know about these.

On VT switch, all slave devices are temporarily removed, so the cascade of
signals will make the seat end up with capabililities=0 while input is suspended.

https://bugzilla.gnome.org/show_bug.cgi?id=733563
2014-07-23 22:07:16 +02:00
Rui Matos
f55737ec06 compositor: Sync X drawing only once per frame
We only need to call XSync() once per frame to synchronize X with GL
drawing.

https://bugzilla.gnome.org/show_bug.cgi?id=728464
2014-07-23 13:59:18 -04:00
Carlos Garnacho
32565e096d wayland: Notify modifiers after keymap changes
Anytime the keymap is changed, either directly, or indirectly through the
keyboard capability being released/initialized, there should be a
notification of the modifiers being changed too.

https://bugzilla.gnome.org/show_bug.cgi?id=733563
2014-07-23 14:53:46 +02:00
Carlos Garnacho
1677a068ce wayland: Unset keyboard/pointer focus when releasing the data for these devices
Otherwise the focus_surface_listener list element becomes stale, and then
mangled if the devices' data is initialized again, and the memory memset().

https://bugzilla.gnome.org/show_bug.cgi?id=733563
2014-07-22 18:01:29 +02:00
Carlos Garnacho
a02b8441b1 wayland: set the interface vfuncs when declaring the touch interface
Otherwise the NULL vtable would be accessed when trying to release the touch
device.

https://bugzilla.gnome.org/show_bug.cgi?id=733563
2014-07-22 18:01:29 +02:00
Carlos Garnacho
dfe1c106f2 wayland: set the interface vfuncs when declaring the keyboard interface
Otherwise the NULL vtable would be accessed when trying to release the keyboard.

https://bugzilla.gnome.org/show_bug.cgi?id=733563
2014-07-22 18:01:29 +02:00
Jasper St. Pierre
e49bbe2ed8 cursor-tracker: Don't require a screen
This allows us to do initialization earlier and not have to poke into
Wayland internals from the cursor tracker.
2014-07-22 11:10:14 -04:00
Adel Gadllah
6ee5a1437c x11: Move event filter to backend connection 2014-07-19 18:51:26 +02:00
Jasper St. Pierre
c9a2a561f8 wayland: Use a named #define for the xdg-shell version 2014-07-17 17:48:30 -04:00
Jasper St. Pierre
ac0b2fdc6f wayland: Use our named #define for the wl_shell version 2014-07-17 17:47:14 -04:00
Jasper St. Pierre
46b9984414 wayland: Don't leak an extra xdg_shell resource
No idea how this happened...
2014-07-17 17:47:10 -04:00
Jasper St. Pierre
f9743e2174 wayland: Fix indentation 2014-07-17 17:39:43 -04:00
Jasper St. Pierre
a3c55c2692 wayland: Don't emit SIZE_CHANGED on every commit
Save a little bit of effort here.
2014-07-17 17:27:52 -04:00
Jasper St. Pierre
692eb4d957 wayland: Replace set_margin with set_window_geometry 2014-07-17 16:45:37 -04:00
Jasper St. Pierre
826751429b wayland: Treat the size in the configure event as frame rect coordinates 2014-07-17 16:45:37 -04:00
Jasper St. Pierre
5621d3c0c7 wayland: Fix the sign for the geometry coordinates
I got the spaces for window geometry coordinates vs. surface coordinates
mixed up.
2014-07-17 16:42:41 -04:00
Jasper St. Pierre
b5f46c9171 wayland: Calculate the window geometry based on all subsurfaces
Not just the main surface.
2014-07-17 16:20:19 -04:00
Jasper St. Pierre
166b8c042c wayland: Don't fizzle out attaches 2014-07-17 16:18:01 -04:00
Jasper St. Pierre
d34ece6f1a wayland: Don't send superfluous configures for uninteresting grab ops 2014-07-17 16:03:03 -04:00
Jasper St. Pierre
679844f791 display: Call meta_window_grab_op_ended after everything else is reset
This properly sends the resizing state to the correct Wayland surface.
2014-07-17 16:03:01 -04:00
Jasper St. Pierre
9316256e10 wayland: Use the variables we already have 2014-07-17 15:27:47 -04:00
Jasper St. Pierre
90d7737fc1 wayland: Don't require a new buffer to move windows with dx/dy
This doesn't match what Weston does. I don't know of any apps that this
fixes (we don't have any apps that even use non-zero dx/dy, I don't
think), but this is part of a cleanup for window geometry.
2014-07-17 14:51:23 -04:00
Jasper St. Pierre
567ca15610 xdg-shell: Update to latest 2014-07-17 14:51:12 -04:00
Jasper St. Pierre
558b323485 xdg-shell: Fix typo 2014-07-17 14:50:40 -04:00
Jasper St. Pierre
5df59f75cd restart: Fix pointer/XID confusion
This causes an error in recent gcc.
2014-07-17 11:50:58 -04:00
Adel Gadllah
029673d0ee Revert "backend-x11: Take the touch grab on the stage window"
This reverts commit 3b85e4b2b9.

This breaks touch support; reverting would break wayland
(is what this patch tried to fix; we should find a better solution
that works on both).
2014-07-17 17:18:08 +02:00
Owen W. Taylor
3a57f843d5 Add a framework for restarting the compositor with nice visuals
The current GNOME Shell Alt-F2 restart looks very messy and also
provides no indication to the user what is going on. We need to
restart the compositor to switch in and out of stereo mode, so
add a framework for doing this more cleanly:

Additions:

 meta_restart(): restarts the compositor with a message
 MetaDisplay::show-restart-message: signal the embedding
    shell to show a message
 MetaDisplay::restart: signal the embedding shell to restart
    itself.
 meta_is_restart(): indicates whether the current instance is a
                    restart so we can suppress login animations.

A helper program meta-restart-helper holds the composite overlay
window up during the restart to avoid visual artifacts.

https://bugzilla.gnome.org/show_bug.cgi?id=733026
2014-07-16 18:09:25 -04:00
Owen W. Taylor
182a267f69 Connect to ClutterStage::after-paint with connect_after()
Use connect_after() to accomodate code in GNOME Shell that,
when benchmarking drawing performance, connects to ::after-paint
and calls glFinish(). The timing information from that will be
more accurate if we hold off until that completes before we signal
apps to begin drawing the next frame. If there are no other
connections to ::after-paint, connect() vs. connect_after() doesn't
matter.

https://bugzilla.gnome.org/show_bug.cgi?id=732350
2014-07-16 13:38:15 -04:00
Jasper St. Pierre
bc8328d7c2 screen: Select for events on the guard window on the backend connection
Otherwise, we'll never see them. This fixes the background menu not
working in gnome-shell.
2014-07-15 17:18:37 -04:00
Jasper St. Pierre
12c1a06e60 screen: Don't select for key and motion events on the root window
These aren't necessary, and we'll never see these events anyway, since
we don't process input events on the frontend connection.
2014-07-15 17:18:37 -04:00
Jasper St. Pierre
b11405570a compositor: Don't bother selecting for events on the COW
We already select all the events we need on the stage window instead.
2014-07-15 17:18:37 -04:00
Jasper St. Pierre
3b85e4b2b9 backend-x11: Take the touch grab on the stage window
So we don't get assert fails when touching the screen on mutter nested.
2014-07-14 17:24:31 -04: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
2a3d4b62a7 keybindings: Fix backend check in change_keygrabs
We really can't do this unless the backend X server is the same as the
frontend X server, as we pass a frontend XID to the backend, which is
only the case when we're not a Wayland compositor.
2014-07-14 15:31:19 -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
06e4778072 iconcache: Group declarations where they're used 2014-07-14 11:30:03 -04:00
Jasper St. Pierre
92388892b3 iconcache: Remove dead code 2014-07-14 11:27:51 -04:00
Jasper St. Pierre
5d124ac00a iconcache: Remove commented out code 2014-07-14 11:27:51 -04:00
Jasper St. Pierre
a57c3ae105 iconcache: Remove want_fallback hint
It's unused, and if it was ever set, it would cause an assert fail.
2014-07-14 11:27:50 -04:00
Jasper St. Pierre
55354f5c38 Take the touch grab in MetaBackendX11
This means that it won't trigger when we're running as a Wayland
compositor, which will cause a few warnings and possibly more
brokenness.
2014-07-14 09:41:10 -04:00
Jasper St. Pierre
379bb0a77d screen: Don't make a round-trip to fetch a value we know to be empty 2014-07-14 09:40:43 -04:00
Jasper St. Pierre
39357fc242 window-props: Don't make another round-trip to fetch the opaque region
We already have the property value from our property fetching.
2014-07-13 22:51:25 -04:00
Jasper St. Pierre
799de4f0f4 frames: Don't make a round trip to the X server for every MotionNotify
Instead, simply use the coordinates that were passed to us from the
MotionNotify event.
2014-07-13 17:34:08 -04:00
Jasper St. Pierre
c34b5c1cf0 Makefile: Disable Clutter / Cogl deprecation warnings
These just spam up our logs, and they aren't getting fixed any time
soon for a variety of reasons. Just disable them to ensure that really
important warnings get noticed and fixed.
2014-07-13 11:46:13 -04:00
Jasper St. Pierre
46361c3e28 events: Return early if we close the display
This is so we won't poke into the MetaDisplay, which is invalid memory,
and crash. This can sometimes work right now because GSlice might not
deallocate the object immediately, but it's still not a fun thing to do.
2014-07-13 11:43:28 -04:00
Jasper St. Pierre
f9d33b2efc display: Add an extra check inside meta_display_close
For clarity of what the expected input to this function is.
2014-07-13 11:37:31 -04:00
Jasper St. Pierre
2185904fcb display: Use a local here instead of the global the_display
This will make it easier to split some of this functionality out into
other subfunctions.
2014-07-13 11:35:38 -04:00
Jasper St. Pierre
eb952819c2 monitor: Don't use wl_output_transform in our APIs
Invent our own API so we can build without Wayland headers.
2014-07-13 11:35:01 -04:00
Jasper St. Pierre
d7d8c92a9a Remove unused Wayland includes 2014-07-13 11:35:01 -04:00
Owen W. Taylor
88a7790d44 MetaDisplay: remove meta_display_grab()/ungrab()
Now that we have two connections to the X server, the idea of a
ref-counted server grab that might be held across extended portions
of code is very dangerous since we might try to use the backend
connection while the frontend connection is grabbed.

Replace the only usage (which was local) with direct
XGrabServer/XUngrabServer usage and remove the meta_display_grab()
API.

https://bugzilla.gnome.org/show_bug.cgi?id=733068
2014-07-11 13:39:07 -04:00
Owen W. Taylor
806dabe2d7 Don't grab the server when unmanaging the screen
There's no obvious reason for grabbing the X server when unmanaging
a screen - the only race conditions a server grab solves are those
related to querying and then acting on the results of the query.

Our shutdown sequence is correctly ordered according to the ICCCM -
we first unselect on the root window, and then we destroy the
window owning WM_S<n> so removing the grab should not cause any
problems when we are being replaced with another window manager.

https://bugzilla.gnome.org/show_bug.cgi?id=733068
2014-07-11 13:39:07 -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
bee97ab6a7 window-props: Make sure that recalc_window_type is always called 2014-07-10 17:07:52 -04:00
Jasper St. Pierre
59fc17c355 util: Turn STACK debugging back off
Snuck in by accident.
2014-07-10 16:54:48 -04:00
Jasper St. Pierre
5f25ca0c3a stack-tracker: More small cleanups 2014-07-10 16:29:35 -04:00
Jasper St. Pierre
41b4a079c7 stack-tracker: Remove unused variable 2014-07-10 16:29:35 -04:00
Jasper St. Pierre
e4235376d8 stack-tracker: Add some more debug output 2014-07-10 16:29:34 -04:00
Jasper St. Pierre
043a201f90 stack-tracker: Clean up dumping 2014-07-10 16:29:18 -04:00
Jasper St. Pierre
d1a588a94f stack-tracker: Fix the case where the serial is too old
The code here before was just flat out wrong, and made us consistently
requery the server at startup.
2014-07-10 16:02:01 -04:00
Jasper St. Pierre
01b6d9bfe2 stack-tracker: Fix code style 2014-07-10 16:00:38 -04:00
Jasper St. Pierre
9711d95996 stack-tracker: Fix comments 2014-07-10 16:00:38 -04:00
Jasper St. Pierre
b87db00fdb window-props: Fizzle out PropertyNotifies that happen after initial map
Properties like _NET_WM_DESKTOP and _NET_WM_STATE are supposed to be
ignored after the initial map of the window, so ignore any
PropertyNotifies for these.
2014-07-10 15:05:42 -04:00
Jasper St. Pierre
6190b65056 window-props: Use a flags-based approach for our prop hooks
This allows us to extend the table better with newer flags.
2014-07-10 15:05:42 -04:00
Jasper St. Pierre
10fe91d704 window-props: Don't load WM_STATE
Since we don't do anything with it.
2014-07-10 15:05:42 -04:00
Jasper St. Pierre
36bb05b10e window-props: Fix assert testing
I have *no* idea how this even compiled in the first place. What the hell?
2014-07-10 15:05:42 -04:00
Jasper St. Pierre
a7b7213017 window-props: Use the standard property type system for _NET_WM_WINDOW_TYPE 2014-07-10 15:05:40 -04:00
Jasper St. Pierre
031154a400 window-props: Use the standard property type system for WM_WINDOW_ROLE
There seems to be no reason we can't just use this.
2014-07-10 14:56:23 -04:00
Jasper St. Pierre
463b50e746 screen: Fetch the COW window up-front
XGetCompositeOverlayWindow is a round trip to the X server. We shouldn't
be doing it on every MapWindow.
2014-07-10 14:18:02 -04:00
Jasper St. Pierre
1749a85e96 frame: Only XSync when we're on the X11 compositor backend
The only case we have is the case where the two X11 connections are the
same. When on Wayland, the XSync is costly and expensive, and we should
minimize it.
2014-07-10 13:31:26 -04:00
Jasper St. Pierre
1af9e92e91 Don't add in our old input event mask when we select input events
This causes a round-trip to the server, and just isn't necessary, since
we're always in charge of our event mask.
2014-07-10 13:30:05 -04:00
Jasper St. Pierre
12d0c98fb5 wayland: Remove an unused field from MetaWaylandFrameCallback 2014-07-10 13:30:05 -04:00
Jasper St. Pierre
817c6986a0 wayland: Remove a few unused fields from MetaWaylandCompositor 2014-07-10 13:30:05 -04:00
Jasper St. Pierre
7c68aaea4c data-device: Put the DataDevice implementation in its own struct 2014-07-10 13:30:05 -04:00
Jasper St. Pierre
6fea46e0cf data-device: Use a better variable name than "resource" 2014-07-10 13:30:05 -04:00
Jasper St. Pierre
59fa74fed1 data-device: Don't look up the same client twice in two different ways 2014-07-10 13:30:05 -04:00
Jasper St. Pierre
581335fbea data-device: Start a cleanup 2014-07-10 13:30:04 -04:00
Jasper St. Pierre
9b5d6cc008 wayland: Remove seat->display
It's unused.
2014-07-10 13:30:04 -04:00
Jasper St. Pierre
d0f98ec1ba wayland: Fix include ordering
This puts it in the same order as the types in the struct.
2014-07-10 13:30:04 -04:00
Jasper St. Pierre
a977fcf3d0 wayland: Add a wrapper for set_input_focus
So we're not poking into seat internals.
2014-07-10 13:30:04 -04:00
Jasper St. Pierre
664f6ef420 wayland: Move DataOffer / DataSource into data-device internals 2014-07-10 13:30:04 -04:00
Florian Müllner
06a31992e3 screen: Tweak workspace initialization (again)
Commit 8100cefd4c fixed a crash during workspace initialization by
tweaking the startup sequence; as a result, the plugin (like gnome-shell)
is now started before workspaces are fully initialized, which breaks
some reasonable assumptions (like always having an active workspace).
This is particularly problematic considering that the code making those
assumptions is not necessarily our own (extensions!), so return to
fully initialize workspaces before the compositor again.
At the same time, make sure to only call meta_workspace_activate()
once during initialization to avoid reintroducing the crash.

https://bugzilla.gnome.org/show_bug.cgi?id=732695
2014-07-10 17:50:59 +02:00
Jasper St. Pierre
4e2092d593 gesture-tracker: Rename files to include the meta- prefix 2014-07-08 13:30:26 -04:00
Jasper St. Pierre
9755f308e5 gesture-tracker: Update documentation format 2014-07-08 13:28:48 -04:00
Jasper St. Pierre
09610daea1 gesture-tracker: Don't pass an autodeny-timeout
Just use the default value of 250.
2014-07-08 13:27:38 -04:00
Jasper St. Pierre
13b7fa4eba ui: Bring back the is_input_event helper
This makes the logic clearer and easier to reason about.
2014-07-08 12:59:35 -04:00
Jasper St. Pierre
909a46087f ui: Fix the check for the XInput opcode
When converting is_input_event to be the opposite, I forgot to make this
change.
2014-07-08 12:58:43 -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
Carlos Garnacho
789608b637 gesture-tracker: Implement threshold-based sequence rejection
If a sequence moves past a certain distance without being used by a
gesture, reject it so clients may see and react to it ASAP. This makes
gestures to be began by initially quasi-static touchpoints, in addition to
quasi-simultaneous.
2014-07-08 11:30:12 -04:00
Carlos Garnacho
d05b750b8d frames: Keep information about the ongoing grab operation, and retry if needed.
When a passive touch grab is rejected over the frame, management is punted to
the frame itself, and pointer events emulated, but the attempt to transfer the
grab from the GDK connection to the Clutter one fails with AlreadyGrabbed, and
will fail until the Clutter connection receives the XI_TouchEnd resulting from
XIRejectTouch, gotten after the XI_ButtonPress on the GDK connection.

In order to bypass this shortcoming, store the current grab operation on the
frame as long as the button is pressed, so it is retried once on the next
motion event happening during frame dragging, that will have a recent enough
timestamp to succeed. If no grabbing succeeded, the current grab operation
data will be reset on GDK_BUTTON_RELEASE.
2014-07-08 11:21:36 -04:00
Carlos Garnacho
704cae1de3 backend: Use the most recent event time on replayed touch events
When a touch sequence is passively grabbed and later rejected, events
will be replayed on the next client in propagation order, although those
events (either transformed to pointer events or not) will contain the
original timestamps, this will make grabs fail with InvalidTime if triggered
from the replayed ButtonPress/TouchBegin handler.

In order to work around this, store the most recent event time (presumably
gotten from the XI_TouchEnd caused by the passive grab being rejected), and
use that time on the events being replayed afterwards and grabs, so we don't
possibly fail with InvalidTime if those events result in a compositor grab.
2014-07-08 11:21:29 -04:00
Carlos Garnacho
23b074481a display: Set an X11 passive touch grab on the root window
Touch events will be caught first by the compositor this way,
whenever the MetaGestureTracker notifies of the accepted/rejected
state of a sequence, XIAllowTouchEvents() will be called on it
accordingly, so it is handled exclusively by the compositor or
punted to clients.
2014-07-08 11:21:29 -04:00
Carlos Garnacho
5dc8fa6690 events: Hook MetaGestureTracker to display event processing
Events aren't actually consumed by the MetaGestureTracker, but it
rather defines whether the event will reach clients, or the stage.
2014-07-08 11:21:29 -04:00
Carlos Garnacho
a9ba98686f display: Add a global MetaGestureTracker 2014-07-08 11:21:28 -04:00
Carlos Garnacho
59382bace2 core: Add MetaGestureTracker
This object tracks both touch sequences happening on the stage and
gestures attached to the stage actor. When a gesture emits
::gesture-begin, All triggering sequences and future ones will be
marked as "accepted" by the compositor, and events will be listened
for meanwhile there are active gestures.

If a sequence goes unclaimed for a short time, it will be
automatically "denied", and punted to the client or shell element
below.
2014-07-08 11:21:28 -04:00
Jasper St. Pierre
2edf822bc6 ui: Fill in more fields on our emulated motion / crossing events
This will be required by the gestures work.
2014-07-08 11:21:24 -04:00
Jasper St. Pierre
355621b0ab ui: Remove a superfluous set on emulated motion events
This is already set by the gdk_event_new above.
2014-07-08 11:20:35 -04:00
Jasper St. Pierre
a307e13a63 ui: Filter out touch events 2014-07-08 10:50:09 -04:00
Giovanni Campagna
f807207b65 window: expose meta_window_is_client_decorated() in the API 2014-07-08 12:10:54 +02:00
Jasper St. Pierre
30b54aae34 frame: Don't select for core events on the frame window
We override these with XI2 event types anyway. There's no point to
selecting to them.
2014-07-07 19:22:09 -04:00
Carlos Garnacho
79e682bcd0 compositor: emit grab-op-begin/end signals on plugin grabs
This makes it possible to track there grabs triggered this way, in
addition to the ones handled by mutter.
2014-07-07 19:18:21 -04:00
Carlos Garnacho
a05ae8654c events: Update current time on CLUTTER_TOUCH_BEGIN events
Just as with key/button press events, update the current interaction
time when a touch begins on a window.
2014-07-07 19:17:06 -04:00
Carlos Garnacho
0db172edbf ui: Remove XI_TouchBegin handling from window frame event handlers
This is now unnecessary as only pointer events are selected, so pointer
emulation will take care of sending only pointer events.
2014-07-07 19:17:06 -04:00
Carlos Garnacho
7b0930f798 frame: Only select for ButtonPress/Release/Motion/Crossing
Touch events are largely ignored on GdkEvent emulation, so only
make frames receive pointer events, only the pointer emulating
touch will be reported, and any other further touches will be
ignored, which is about the behavior we want. This makes window
dragging possible again on touch.
2014-07-07 19:17:06 -04:00
Carlos Garnacho
0919b37c34 ui: Remove unneeded code
There's no way now that GDK will hold a grab, so it is safe to remove
this now.
2014-07-07 19:17:05 -04:00
Carlos Garnacho
faf55c4627 backend-x11: Ensure touch event coordinates are translated to the stage's
Now that those events are going to be received, coordinates translation
should also happen on those.
2014-07-07 19:17:03 -04:00
Carlos Garnacho
f351c5d304 backend-x11: Remove pointless goto
The function is not as complex as needing that, plus it always jumped
anytime bypass_clutter is TRUE, so make all conditional code depend on
that.
2014-07-07 19:15:48 -04:00
Jasper St. Pierre
63bca17ab6 backend-x11: Only spoof the event when we're passing it to Clutter
There's no need to do so otherwise.
2014-07-07 19:13:31 -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
1de2fd7122 window-wayland: Check to update the buffer_rect separately
When frame extents change, we might not update the frame rect, but the
buffer rect still needs to be updated. Split out the check for this to
be independent of the check for the frame rect.

This fixes issues that could happen when the window was maximized while
it was in the top-left corner.
2014-07-07 13:07:37 -04:00
Jasper St. Pierre
e377e82cfd theme: Remove bogus comment
This isn't happening anytime soon.
2014-07-07 12:54:36 -04:00
Rico Tzschichholz
fa8174a200 gradient: Fix warning/typo
In addition to c068c2122d
2014-07-07 10:59:23 +02:00
Florian Müllner
ef95133b1c theme: Also support alpha values in blend/shade functions
This doesn't appear to be used currently, but fix it while at it ...
2014-07-03 20:09:49 +02:00
Florian Müllner
c068c2122d gradient: Support alpha values in colors
Designers got used to RGBA support in GTK+, so the colors we pick
up from there might well have an alpha channel; update our gradient
rendering to support this - eventually we should probably port that
code to cairo ...
2014-07-03 20:01:51 +02:00
Florian Müllner
d8c47b0abd gradient: Remove unused parameter 2014-07-03 20:01:51 +02:00
Jasper St. Pierre
66eb4bc34c wayland-surface: Make sure to apply the margin before moving the window 2014-07-03 10:31:26 -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
Giovanni Campagna
8d08851f28 compositor: show the stage after we set the size
So that it is actually respected
2014-07-01 20:28:00 +02: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
110c79d10e monitor-manager: Rename output_id to output_index
The term "output_id" is already used as an opaque ID.
2014-07-01 13:01:02 -04:00
Jasper St. Pierre
b9d867cb86 monitor-manager: Remove duplicate variable definition 2014-07-01 13:00:57 -04:00
Jasper St. Pierre
ea3b961e43 window-wayland: Make sure the size of the buffer rect is kept up to date
When we changed the setting of the buffer rect to be inside the moving
code to make sure it was updated in places we were moving directly
without any round-trip needed, I removed a code to set the buffer rect
without remembering that's where the size of it was updated.

Add back the code to update the buffer rect.

This fixes Wayland windows not appearing.
2014-07-01 11:27:26 -04:00
Owen W. Taylor
bc510378b3 Switch to using ClutterStage::after-paint
The experimental API clutter_stage_set_paint_callback() is replaced
with an ::after-paint signal as of Clutter 1.19.5.
2014-06-27 14:36:32 -04:00
Jasper St. Pierre
0a47d135ac screen: Fix up last commit
Forgot to squash after building.
2014-06-27 14:05:38 -04:00
Jasper St. Pierre
ec8ed1dbb0 screen: Set a black background for testing purposes 2014-06-27 12:38:11 -04:00
Jasper St. Pierre
203e5335ab window-x11: Fizzle out changes to the three different regions
GTK+ likes to set these, well, _NET_WM_OPAQUE_REGION in particular, to
the same value. Save some expensive and processing when this happens. We
should probably make GTK+ smarter.
2014-06-27 12:18:42 -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
Owen W. Taylor
8d29d22e99 meta_accelerator_parse(): handle keysyms without the XF86 prefix
The GDK and hence GNOME standard is that keys that begin with XF86 according to
libxkbcommon not prefixed with XF86, though gdk_keyval_from_name() strips XF86
if provided. If libxkbcommon doesn't recognize the accelerator name without
XF86, try again adding XF86 to the start.

This restores compatibility with gnome-settings-daemon, schemas, and existing
user configuration.

https://bugzilla.gnome.org/show_bug.cgi?id=727993
2014-06-27 10:37:42 -04:00
Owen W. Taylor
9c6e527d4b Add ::first-frame signal to MetaWindowActor
This signal is emitted the first time a frame of contents of the
window is completed by the application and has been drawn on the
screen. This is meant to be used for performance measurement of
application startup.

https://bugzilla.gnome.org/show_bug.cgi?id=732343
2014-06-27 10:37:42 -04:00
Jasper St. Pierre
077606c057 window-wayland: Correct the buffer rect for frame extents 2014-06-26 13:58:11 -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
Giovanni Campagna
c562657f1e main: kill custom log handler
It just gets in the way of gnome-shell's log handler (which
includes gjs backtraces optionally), it requires people to understand
what 8 or 16 mean as log levels, and it loses the log domain.
2014-06-26 19:10:28 +02:00
Marek Chalupa
c14382181f wayland window: update buffer_rect when moving
Update both - rect and buffer_rect positions when moving wayland window

https://bugzilla.gnome.org/show_bug.cgi?id=731237
2014-06-26 10:50:29 -04:00
Marek Chalupa
b2183dfda7 wayland-pointer: fix condition for grabbing
It returns FALSE when button_count is not 0. But grabbing for
move/resize is activated by clicking the button, so this condition
disallows the wayland clients to be moved/resized.

https://bugzilla.gnome.org/show_bug.cgi?id=731237
2014-06-26 10:50:29 -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
ff8d5281f0 frames: Simplify the clip region calculation
Since GTK+ already clips to the extended region for us, there's no need
to combine the two. This does lose the fast-path, but I don't actually
expect this to fire, as when we're composited, we really won't ever get
partial exposes.
2014-06-21 13:50:44 -04:00
Jasper St. Pierre
4f9b994e73 frames: Don't bother painting the background
GDK (and also GTK+!) do this for us already.
2014-06-21 13:50:43 -04:00
Jasper St. Pierre
b8b0dc5c78 frames: Hackily adapt to GTK+ drawing changes
mutter is quite bad at using GTK+ correctly, relying on dumb things
like the single-buffering stuff. Hack up a temporary fix for the
newer GTK+ rendering changes.
2014-06-21 13:50:36 -04:00