Commit Graph

6444 Commits

Author SHA1 Message Date
Matthias Clasen
690a11b5b8 wayland: Stop key repeat on focus out
This should address the occasional 'key repeat gone wild' issue
that some people have been seeing in gnome-terminal under Wayland.

http://bugzilla.gnome.org/show_bug.cgi?id=747684
2015-08-31 11:07:00 -04:00
Matthias Clasen
77b506e22a wayland: Stop key repeat when a seat goes away
Seems unlikely, but it is the right thing to do.
2015-08-31 11:07:00 -04:00
Matthias Clasen
cfeed32c4e wayland: Trivial refactor
Break out a stop_key_repeat function instead of open-coding this
in several places.
2015-08-31 11:07:00 -04:00
Matthias Clasen
ea66300cf9 wayland: Make display closing work
The code in _gdk_wayland_window_dispose was not safe against
being called twice - it would call g_hash_table_destroy twice
on the known_globals hash table, the second time operating on
freed memory. It was also leaking the list of async_roundtrips.

After fixing both of these issues, the displayclose testcase
now works on Wayland.
2015-08-28 16:15:26 -04:00
Matthias Clasen
0dc6726f02 wayland: Be more careful when destroying windows
We call gdk_wayland_window_hide_surface when the window gets
destroyed, and in this case, the frame clock might not exist
anymore.

This was showing up in the displayclose testcase.
2015-08-28 16:15:26 -04:00
Matthias Clasen
de684dac1b Trivial formatting fix 2015-08-28 16:15:26 -04:00
Matthias Clasen
578ba0f974 wayland: Don't assert non-recursing in gdk_window_destroy
While we do not have subwindows in Wayland, we do create an
artificial root window. When the display is closed, the root
window gets destroyed, causing recursing to be true for the
toplevel windows.
2015-08-28 16:15:26 -04:00
Matthias Clasen
dc79d4f50d Trivial formatting fix 2015-08-28 16:15:26 -04:00
John Ralls
c55ff6e41f Bug 736125 - The default gtk accelerator mod mask does not include all default backend modifiers 2015-08-25 15:54:58 -04:00
Jonas Ådahl
32cd1a7447 wayland: Only bind supported unstable pointer gestures global
As the protocol is still considered unstable (meaning not backward
compatible), we should, as stated in the protocol, only bind the version
advertised is the version we implement.

https://bugzilla.gnome.org/show_bug.cgi?id=753856
2015-08-21 10:04:02 +08:00
Carlos Garnacho
25557c1c5d gdkevent: Hold refs to device/source_device
The extra reference will be held from GdkEventPrivate data, so there's
a common place to all events. Without this, events queued after devices/
capabilities disappear (eg. on TTY switch) might hold invalid pointers.
Windowing level operations on those devices (queries, grabs...) are
expected to fail at that time, but we should hold meaningful data for
the regular event handling paths.

https://bugzilla.gnome.org/show_bug.cgi?id=753185
2015-08-19 22:13:08 +02:00
Jonas Ådahl
e1fd87728d wayland: Use g_get_prgname() to get the xdg_surface.set_app_id string
Prior to this patch, the ID of the GtkApplication was always used for
clients which were GtkApplications. This would only be guaranteed to be
correct for D-Bus activatable programs. As a result, all
non-D-Bus-activatable applications would set the wrong ID making the
shell unable to find the corresponding .desktop file.

This change makes it so that the GDK backend always uses the name
passed to g_set_prgname, or the default value if not explicitly set, as
this more often corresponds to the .desktop file.

This means that in order to make D-Bus activatable applications set the
correct application ID, they must, for now, manually call
g_set_prgname() with their application ID (basename of the .desktop
file).

If g_get_prgname() returns NULL, fallback to gdk_get_program_class()
even though it will most likely never be correct according to the
xdg_surface.set_app_id specification.

https://bugzilla.gnome.org/show_bug.cgi?id=746435
2015-08-18 08:45:12 +08:00
Matthias Clasen
b437f89c05 Add a note to gdk_screen_get_width/height_mm
The values returned by these functions are not very well defined,
recommend to use the monitor dimensions instead.
2015-08-15 22:20:16 -04:00
Carlos Garnacho
02f3fe0671 wayland: calculate screen physical size
A simple calculation is done so far (assuming monitor areas never overlap)
so gdk_screen_get_width/height_mm return meaningful values.

https://bugzilla.gnome.org/show_bug.cgi?id=753621
2015-08-15 22:11:10 -04:00
Ray Strode
83c25169e8 Revert "wayland: require WAYLAND_DISPLAY be set to open wayland display"
This reverts commit 35489f5d31.

It snuck in when i was trying to push

commit f4d2022d46
2015-08-14 11:24:44 -04:00
Ray Strode
f4d2022d46 wayland: change wl_log level to G_LOG_LEVEL_DEBUG
wl_log() currently logs using G_LOG_LEVEL_ERROR
(which is fatal). The wayland client library doesn't
expect this behavior. It uses wl_log to log recoverable
errors.

This commit changes the log level to G_LOG_LEVEL_DEBUG
instead.

https://bugzilla.gnome.org/show_bug.cgi?id=753635
2015-08-14 11:06:48 -04:00
Ray Strode
35489f5d31 wayland: require WAYLAND_DISPLAY be set to open wayland display
The wayland client libraries now require WAYLAND_DISPLAY be set
to use them.

See:

http://cgit.freedesktop.org/wayland/wayland/commit/?id=fb7e13021730d0a5516ecbd3712ea4235e05d24d

This commit makes _gdk_wayland_display_open bail early if
WAYLAND_DISPLAY is unset, just as it does for XDG_RUNTIME_DIR.
2015-08-14 10:28:31 -04:00
Руслан Ижбулатов
4a26366ff2 GDK W32: Add missing commas 2015-08-14 12:12:01 +00:00
Carlos Garnacho
45d15b302e wayland: Implement touchpad gesture events
On wayland, the gestures protocol defines a wl_pointer_gestures global
object, that will match in number with wl_seats, swipe and pinch
interfaces can be obtained from it, which events are translated into
GdkEventTouchpadSwipe/Pinch events.
2015-08-12 23:20:25 +02:00
Carlos Garnacho
b037d4d628 wayland: Add touchpad gestures protocol 2015-08-12 23:20:25 +02:00
Carlos Garnacho
5092febaf8 gdk: Proxy touchpad events through the client-side window hierarchy
This includes poking the deepmost window, checking for the
GDK_TOUCHPAD_GESTURE_MASK bit set, and translating coordinates in events
accordingly.
2015-08-12 23:20:24 +02:00
Carlos Garnacho
8c2b3930da gdk: Add GDK_TOUCHPAD_GESTURE_MASK to GdkEventMask
Users will need to manually select on this in order to receive gesture
events.
2015-08-12 23:20:24 +02:00
Carlos Garnacho
a3b402a949 gdk: Add touchpad gesture events and event types.
Each gesture type has its separate GdkEvent struct, and begin/update/
end/cancel event types.

There is support for multi-finger swipe (3-4 fingers), and 2-finger
rotate/pinch gestures.
2015-08-12 23:20:24 +02:00
Christoph Reiter
6eaf5bd0f2 quartz: Implement CSD drag resize for all edges/corners
Manual resizing for CSD windows only worked with the bottom
right corner. This extends it to work for all corners and edges.

https://bugzilla.gnome.org/show_bug.cgi?id=753329
2015-08-08 13:28:35 +02:00
Jonas Ådahl
27763743b1 wayland: Don't assume drag context has a source window when finalizing
Only a drag context which was created with 'drag_begin' will be
guaranteed to have a source window at all times. Thus, in finalize we
cannot assume we can retrieve a GdkDisplay from the source_window
pointer since it may be NULL. Though, the display is only needed for
contexts created via 'drag_begin' thus we can retrieve it after
checking that is the case.

https://bugzilla.gnome.org/show_bug.cgi?id=749339
2015-08-05 10:31:55 +08:00
Rui Matos
bd3b496586 wayland: Ensure modal hint gets set on map
We need to be mapped to have a gtk_surface and thus be able to do
requests on it so we need to save the modal hint and apply it when we
get mapped so that code that sets the hint before showing a window
doesn't get ignored.

https://bugzilla.gnome.org/show_bug.cgi?id=753138
2015-08-03 14:24:38 +02:00
Rui Matos
36263076b2 wayland: Invalidate our gtk_surface when we're unmapped
Otherwise if we get mapped again we'll try to use an invalid
gtk_surface and the compositor will disconnect us.

https://bugzilla.gnome.org/show_bug.cgi?id=753138
2015-08-03 14:24:36 +02:00
Matthias Clasen
9f24b54786 Code cleanup
Use g_slist_free_full more consistently. This commit just converts
the obvious cases where g_slist_forall is directly followed by
g_slist_free.
2015-07-31 22:23:35 -04:00
Matthias Clasen
7d87eebfe7 wayland: Return a display name
Make gdk_screen_make_display_name() return a likely correct
name for the Wayland socket we are using.
2015-07-28 00:43:54 -04:00
Matthias Clasen
55edc81c10 x11: Make selection handling work across screens
When dealing with selection events, we might see windows from
other screens in the requestor field. The current x11 backend
code fails to wrap these in a foreign GdkWindow, since we
don't have the corresponding GdkScreen anymore. Work around
this by creating such 'foreign screens' on demand. We still
maintain the 1:1 relation between the display and the screen
returned by gdk_display_get_default_screen().

https://bugzilla.gnome.org/show_bug.cgi?id=721398
2015-07-27 23:20:53 -04:00
Christoph Reiter
2c329f5b3a quartz: disable system shadows if a GdkWindow shadow is set.
The shadow will be drawn in the wrong place in those cases so all we can
do is disable it. This fixes double shadows drawn around menus, popups
and tooltips.

https://bugzilla.gnome.org/show_bug.cgi?id=734984
2015-07-27 17:26:46 +02:00
Patrick Griffis
ee73e27fd7 quartz: Fix building
Broken by 6d04183c5d and 6ac07a2e85
2015-07-27 09:33:32 -04:00
Matthias Clasen
6d04183c5d quartz: Check if a drag ends inside a known window
If a drag ends inside a known window, set the dest_window field
in the drag context. This information is needed to implemented
notebook tab dragging.

https://bugzilla.gnome.org/show_bug.cgi?id=752638
2015-07-26 02:05:47 -04:00
Giovanni Campagna
83b7a0f0e5 wayland: Fix initial fullscreen monitor support
-1 means that we have no specific preference for an initial
fullscreen monitor, and -1 is less than the number of monitors,
so we would end up accessing invalid memory. Prevent that.

https://bugzilla.gnome.org/show_bug.cgi?id=752875
2015-07-26 01:55:56 -04:00
Matthias Clasen
b3fb1aefd8 win32: Support all css cursor names
Approximate some of the resize cursors with similar cursors.
2015-07-26 01:43:56 -04:00
Peter Wu
fffbe61c23 broadway: fix use-after-free on read errors
Call chain:
 - input_data_cb
   - broadway_server_read_all_input_nonblocking (input)
     - broadway_input_free (input)
       (now input is invalid)
     attempt to use input->active -> use-after-free

Make broadway_server_read_all_input_nonblocking return a boolean, TRUE
if the input was valid, FALSE otherwise. This allows input_data_cb to
detect whether the input was gone or not.

https://bugzilla.gnome.org/show_bug.cgi?id=741685
2015-07-26 00:46:13 -04:00
Jeremy Whiting
f9d903995d Added api to set a window to fullscreen on a given monitor.
https://bugzilla.gnome.org/show_bug.cgi?id=752677
2015-07-25 07:08:59 -06:00
Carlos Garnacho
76c1337675 GdkEvent: Turn out parameters optional
As pointed out by lazka in IRC, /me clearly out of phase after allow-none.
2015-07-24 14:42:34 +02:00
Carlos Garnacho
dc9e54887a GdkEvent: Fix introspection annotations on gdk_event_get(_root)_coords
These functions respect NULLs being passed, so the return values are
(nullable).
2015-07-24 13:44:22 +02:00
Pavel Grunt
44608dadc6 gdk-win32: Send fake release key event for shift key
Windows does not send any release key event for one of the shift keys
when both shift keys were pressed together. This commit solves
the problem by sending the extra release key event for the shift key
which was released as first, when the other shift key is released.

Other modifiers (e.g. Ctrl, Alt) do not have this problem.

https://bugzilla.gnome.org/show_bug.cgi?id=751721
2015-07-23 17:52:01 +02:00
Christoph Reiter
7ed5816829 quartz: remove maximized state when the window position/size is changed
So a window can be maximized/zoomed again after being moved away from
its maximized position. This makes the zoom button on non-CSD windows
work as before.
2015-07-23 13:20:05 +02:00
Christoph Reiter
eb37fd22e7 quartz: implement maximized/unmaximized
Instead of using the default zoom behaviour use the internal
maximized state for selecting our own zoom target. This makes
zooming work for CSD windows where for some reason the
given default zoom target is the current window frame itself
resulting in a shadowless window of the same size.

While this makes the zoom button behave a bit different as expected
it makes things more consistent with other platforms and fixes CSD
zooming.
2015-07-23 13:19:09 +02:00
Christoph Reiter
61ce90a8e2 quartz: make moving CSD windows right up to the screen's menu bar work.
The default implementation prevents the window + shadow to move above
the menu bar. Change it so only the window is considered.
2015-07-23 13:18:49 +02:00
Jonas Ådahl
2943bfef46 wayland: Always apply scaling factor to cursor hotspot and dimension
Prior to this patch, the hotspot would be passed in buffer coordinate
space. Where this were ever tested, i.e. in a patched mutter, the
server interpreted them incorrectly, which meant it went undiscovered.
In the updated mutter patches the incorrect behavior in GTK+ was
discovered due to the behavior in mutter was corrected.

In the themed cursor case, the dimensions were not correctly scaled
either, but this had no negative visible effect because the dimension is
only used for reporting damage tracking, and passing a bigger damage
region than surface has no negative visible effects.

https://bugzilla.gnome.org/show_bug.cgi?id=752616
2015-07-20 17:36:38 +08:00
Daniel Hams
e0f0197d0c GdkGLContext little fix to property names and descriptions.
https://bugzilla.gnome.org/show_bug.cgi?id=752502
2015-07-19 14:14:25 -04:00
Matthias Clasen
bb29c1fcc5 gdk: Add some parameter checking
This may help coverity recognize that we're not called with
invalid combinations.
2015-07-17 18:37:20 -04:00
Ignacio Casal Quinteiro
186c8f5254 gdk: fix crash if visual is NULL
cairo_xlib_surface_get_visual might return NULL so we need to
check for NULL before trying to use it.

https://bugzilla.gnome.org/show_bug.cgi?id=752520
2015-07-17 14:26:11 +02:00
Carlos Garnacho
72bfb40ccf Revert "x11: Query pointer devices' scroll valuators on toplevel enter events"
This reverts commit 77b8495bc4.

The commit broke more scenarios than fixed, better to go back to square one.
2015-07-15 21:19:25 +02:00
Owen W. Taylor
6504b2e534 GdkDisplayX11: Properly translate server timestamps from _NET_WM_FRAME_* messages
When using frame times from _NET_WM_FRAME_DRAWN and _NET_WM_FRAME_TIMINGS, we
were treating them as local monotonic times, but they are actually extended-precision
versions of the server time, and need to be translated to monotonic times in the
case where the X server and client aren't running on the same system.

This fixes rendering stalls when using X over a remote ssh connection.
https://bugzilla.gnome.org/show_bug.cgi?id=741800
2015-07-15 12:46:06 -04:00
William Hua
bd71b801de mir: don't ensure_surface if window not visible 2015-07-15 07:43:55 -04:00
William Hua
064f28fcbc mir: don't warn if transient_for is NULL 2015-07-15 07:43:55 -04:00
William Hua
b32899b98a mir: add more default settings under mir 2015-07-15 07:43:55 -04:00
Ryan Lortie
a00a5ed210 GtkApplication: avoid using stale timestamps
Avoid using a stale timestamp (from the last user interaction with the
application) when a message arrives from D-Bus requesting that a new
window be created.

In this case the most-correct thing that we can do is to use no
timestamp at all.

We modify gdk_x11_display_set_startup_notification_id() to allow a NULL
value to mean "reset everything" and then call this function
unconditionally on receipt of D-Bus activation requests.  The result
will be that a missing desktop-startup-id in the platform-data struct
will reset the timestamp.

Under their default configuration metacity and mutter will both map
windows presented with no timestamp in the foreground.  This could
result in false-positive, but there is very little we can do about that
without the original timestamp from the user event.

https://bugzilla.gnome.org/show_bug.cgi?id=752000
2015-07-14 18:34:09 -07:00
Matthias Clasen
bdf0820c50 Simplify Xft setting fallback
If we don't find Xft values in the X resource db, simply fall
back to the values that are hardcoded in /etc/X11/Xresources
anyway. Extra trickery with likely-made-up screen dimensions
is not going to yield better results, and only makes for a
deeper rabbit hole when debugging.
2015-07-07 20:54:16 -04:00
Tom Schoonjans
7d43cda493 gdkwindow-quartz: partial aspect ratio support
Support was added for GDK_HINT_ASPECT in
gdk_quartz_window_set_geometry_hints though with one restriction:
min_aspect and max_aspect have to be equal, which I believe corresponds
to the most common usage. A warning will be printed if this condition is
not met but min_aspect will be used anyway.
2015-07-07 09:36:29 -07:00
Michael Catanzaro
09273d91f3 wayland: print correct coordinates during DnD
Convert wl_fixed values to floats for printing, rather than printing
them as non-meaningful integers.

https://bugzilla.gnome.org/show_bug.cgi?id=752025
2015-07-06 11:32:26 -05:00
Jasper St. Pierre
abc47d7faa gdkdisplay-x11: The leader window should be an input-only window
This prevents it from creating a _NET_WM_USER_TIME_WINDOW, which can
confuse mutter / other window managers, and also me, when debugging.
2015-07-05 17:00:52 -07:00
William Hua
1e6c7e3af0 mir: fix mir pointer event to gdk translation 2015-07-03 13:48:13 -04:00
William Hua
2d223facdc mir: ensure parent surface before creating child surface 2015-07-03 13:48:13 -04:00
Olivier Fourdan
c806f9b709 ignore size inc when maximized/fullscreen
Under Wayland, fullscreen/maximized windows may not cover the entire
area when a size increment is specified.

Ignore size increments for fullscreen/maximized windows just like most
window managers do under X11 so that windows with size increments can
still be fullscreen or fully maximized under Wayland as well.

https://bugzilla.gnome.org/show_bug.cgi?id=751368
2015-07-03 16:21:13 +02:00
Alexander Larsson
ff94923666 broadway: Implement maximization 2015-07-01 21:07:28 +02:00
Carlos Garnacho
77b8495bc4 x11: Query pointer devices' scroll valuators on toplevel enter events
We used to "invalidate" scroll valuators, so the next scroll event could
be used as the base for the next scroll deltas. This has the inconvenience
that it invariably consumes the first event received after enter and,
due to interactions with WM overeager passive button grabs, there's a
possibility we don't scroll at all if we receive interleaved "smooth
scroll" XI_Motion events and XI_Enter events (Normally triggered by regular
scroll wheels in mice).

In order to fix this, and at the expense of some sync-call overhead on
XI_Enter events (one XIQueryDevice call per slave device), query the
current scroll valuator state for all the slaves of the entered pointer,
so we do know beforehand the right base values. If new devices are plugged
while the pointer is on top of the client, the initialized scroll values
will match the valuators'.

https://bugzilla.gnome.org/show_bug.cgi?id=750994
https://bugzilla.gnome.org/show_bug.cgi?id=750870
2015-07-01 19:40:09 +02:00
Carlos Garnacho
0f3995a446 x11: Avoid X error traps within server grabs
gdk_x11_device_xi2_window_at_position() may attempt to push/pop
a few error trap pairs while traversing the window tree. Move it
outside the server grab, and around the multiple XIQueryPointer
calls we may do here.

https://bugzilla.gnome.org/show_bug.cgi?id=751739
2015-07-01 07:42:41 -07:00
Krzesimir Nowak
ef93c714f8 broadway: Fix memleak in error case
https://bugzilla.gnome.org/show_bug.cgi?id=751752
2015-07-01 07:41:13 -07:00
Carlos Garnacho
de68968f89 wayland: Return the right type atom on gdk_selection_property_get()
We mistakenly forced the "STRING" type, which was able to confuse higher
layer helpers like gtk_selection_data_get_uris(). This fixes a crash
happening anytime a drop is attempted on a GtkPlacesSidebar.
2015-06-29 18:39:33 +02:00
Carlos Garnacho
50178ce014 wayland: Prepare against NULL selection owners on data_source requests
Currently, due to the lack of progress information in the Wayland DnD
protocol, we assume a DnD operation is finished after the first
data_source.send is finished (It's either that or leaving stuck grabs).

This however breaks previous assumptions that dest widgets can request
the data multiple times, even in response to GtkWidget::drag-motion.
This leaves us with a NULL owner for the DnD atom when we aren't
finished receiving wl_data_source events yet, causing a crash.

This commit fixes the crash, the behavior left is still far from
desirable though...
2015-06-29 18:39:05 +02:00
Carlos Garnacho
8509a07a08 wayland: Set the master device on the drop-side GdkDragContext
And force the ungrab on it, instead of the slave, in the case of
local DnD drop. This avoids confusions on the pointer events spawn
from DnD, as GDK doesn't think anymore those are from a slave device.
Most namely, it fixes the stuck grab when finishing DnD on the
same app it was started from.
2015-06-26 14:35:41 +02:00
Carlos Garnacho
1178a0ac8b wayland: Split handling of clipboard/DnD data offers
We currently only hold the last offer received, which is wrong, as both
are independent and have different life cycles.

This means we have to store per-selection wl_data_offer and targets, and
maintain these as appropriate from the clipboard/DnD specific entry points.
2015-06-26 14:29:42 +02:00
Alexander Larsson
da395606a2 broadway: Handle shm_open failing by falling back on tmp files
This is required if /dev/shm is not mounted on your system, which can
happen for instance in certain container configurations.
2015-06-26 00:21:27 +02:00
Carlos Garnacho
350d555893 wayland: Fix compile warning in DnD/selection code
Introduced in my recent commits
2015-06-25 18:44:49 +02:00
Carlos Garnacho
6cc9b17429 wayland: Plug some memleaks in DnD/clipboard code
gdk_atom_name() return value must be freed, this code was consistently
not doing so...
2015-06-25 15:09:56 +02:00
Carlos Garnacho
342db27278 wayland: protect against unknown mimetype requests
This oddly can be reproduced with weston+weston-dnd, when dragging
anything from GTK+ into weston-dnd, it will insist on picking its
custom application/x-wayland-dnd-flower mimetype, and this request
forwarded by the compositor, even if GTK+ didn't announce it on
its wl_data_source mimetype list. (What should probably happen here
is that the request is silenced, and/or weston-dnd picks (null))

This should be harmless, we are leaking though the fd in that case,
because the emission of GdkEventSelection on an unhandled mimetype
results in NOP. In order to avoid this, we should check whether the
mimetype is supported at all on the backend code and possibly close
the fd, this involves storing these in the first place.

https://bugzilla.gnome.org/show_bug.cgi?id=751414
2015-06-24 23:52:50 +02:00
Carlos Garnacho
fb266a8876 wayland: Ensure we close the fd on all error paths in data_source.send
https://bugzilla.gnome.org/show_bug.cgi?id=751414
2015-06-24 23:52:50 +02:00
Carlos Garnacho
3bd7b2a6fb wayland: close() the selection fd if we didn't start writing yet
If the other peer requests data too fast (too rare/unlikely though),
we might receive multiple gdk_wayland_selection_request_target() calls
with no ending gdk_wayland_selection_check_write(), in which case the
fd is leaked as no GOutputStream was created to take over it.

https://bugzilla.gnome.org/show_bug.cgi?id=751414
2015-06-24 23:52:50 +02:00
Carlos Garnacho
5e7159413d wayland: Ensure we cancel previous selection writes before starting one
We weren't catching all the places where the AsyncWriteData operation
should be cancelled, which could happen if we repeatedly request the
same target on different fds.

https://bugzilla.gnome.org/show_bug.cgi?id=751414
2015-06-24 23:52:50 +02:00
Carlos Garnacho
69b5955108 wayland: Do not close the descriptor on async_write_data_free()
At the moment we create the AsyncWriteData, the ownership of the
fd is granted to the GOutputStream, and the fd set to -1, so at
this moment we're just silently getting EBADFD.

This partially reverts 25885ca600, the initialization of .fd
to -1 is valid and stays though.

https://bugzilla.gnome.org/show_bug.cgi?id=751414
2015-06-24 23:52:50 +02:00
Carlos Garnacho
de2268000d wayland: Ensure device grabs generate crossing/focus events
On X11 this is something the windowing system does for us, which the
wayland backend should emulate, being grabs completely client-side.

So, if the grab and current focus windows differ, make sure we emit
focus/crossing events as it corresponds to the grab device.
2015-06-24 18:15:46 +02:00
Carlos Garnacho
de260ae2ea wayland: Update grab serial when ungrabbing keyboards
This was being done so only on pointers. Internally, a GdkDeviceGrabInfo
is kept for each of the master pointer/keyboard, failing to do this for
keyboards results in a stuck keyboard grab.

https://bugzilla.gnome.org/show_bug.cgi?id=748892
2015-06-24 16:42:07 +02:00
Carlos Garnacho
25885ca600 wayland: Properly initialize/finalize where we store the data_source.send fd
The fd must be closed on async_write_data_free(), but we should also
initialize it to -1 so gdk_wayland_selection_check_write() doesn't wrongly
pick the stdin fd.

https://bugzilla.gnome.org/show_bug.cgi?id=751414
2015-06-24 16:42:06 +02:00
Matthias Clasen
23ce2562bf Fix up doc comments 2015-06-23 17:27:42 -04:00
William Hua
da14dbe4e5 mir: fix toggling between maximized and restored 2015-06-23 13:17:28 -04:00
William Hua
e083eb42e9 mir: fix wheel scrolling in both directions 2015-06-23 13:17:28 -04:00
William Hua
8fac1f688e mir: emit GDK_ENTER_NOTIFY on pointer enter 2015-06-23 13:17:28 -04:00
William Hua
2374a1b50b mir: remove non-useful logging 2015-06-23 13:17:28 -04:00
William Hua
19f66c781f mir: don't need dummy egl surface 2015-06-23 13:17:28 -04:00
William Hua
be068607f6 mir: emit configure event on window move/resize
Without this, some windows don't restart the paint clock needed to
actually render the contents.
2015-06-23 13:17:27 -04:00
William Hua
9800d83a72 mir: fix build due to missing api 2015-06-23 13:17:27 -04:00
Ting-Wei Lan
3955d93e9d Fix return value error in gdk_window_set_pass_through
https://bugzilla.gnome.org/show_bug.cgi?id=751099
2015-06-17 21:36:35 +08:00
Jonas Ådahl
0dab37c78f wayland: Always request transient commit when mapping subsurface
A subsurface positioning operation only takes effect when the parent
surfaces state is applied. If a subsurface is mapped and positioned, but
the parent surface state is not immediately committed, the relative
position of the subsurface is undefined and may be placed incorrectly.

To avoid this undefined state, always request that the parent surface
should be committed after mapping a subsurface so that the position
operation will take effect.

https://bugzilla.gnome.org/show_bug.cgi?id=751098
2015-06-17 17:41:31 +08:00
Christian Hergert
213b92e644 gdkwindow: avoid updating background pattern if it matches previous
Background patterns are often updated when style changes. In many cases,
the new pattern will match the previous. We can optimize out the
invalidation that will occur upon resetting the same pattern.
2015-06-16 14:40:09 -07:00
Alexander Larsson
4c3eece663 gdk: Add gdk_window_set_pass_through
An pass_through window is something you can draw in but does not
affect event handling. Normally if a window has with no event mask set
for a particular event then input events in it go to its parent window
(X11 semantics), whereas if pass_through is enabled the window below
the window will get the event. The later mode is useful when the
window is partially transparent. Note that an pass-through windows can
have child windows that are not pass-through so they can still get events
on some parts.

Semantically, this behaves the same as an regular window with
gdk_window_set_child_input_shapes() called on it (and re-called any
time a child is changed), but its far more efficient and easy to use.

This allows us to fix the testoverlay input stacking test.

https://bugzilla.gnome.org/show_bug.cgi?id=750568

https://bugs.freedesktop.org/show_bug.cgi?id=90917
2015-06-15 10:56:45 +02:00
Matthias Clasen
7aec96b95f Remove unused variables 2015-06-13 21:10:26 -04:00
Matthias Clasen
5a446284b7 Ensure a variable is initialized
clang complained about transient_for being used uninitialized.
2015-06-13 21:10:25 -04:00
Matthias Clasen
577e9a33bb Remove an unused variable 2015-06-13 21:10:25 -04:00
Matthias Clasen
85a6cafd81 broadway: Avoid compiler warnings
clang doesn't like self-assignment.
2015-06-13 21:10:25 -04:00
Ting-Wei Lan
41b6993a66 Fix 'void function should not return void expression' warning for clang
https://bugzilla.gnome.org/show_bug.cgi?id=750888
2015-06-13 23:00:23 +08:00
Jonas Ådahl
85635457bc wayland: Improve guessing of popup placement for detached popup menus
If a menu was not attached to any widget, we try to calculate its
position given where the grabbed pointer is and what window has its
focus. Previously we failed to do so if a "transfer window" was used
for the grab, and this patch adds a code path that, if the menu window
itself didn't have the grab, look for the transfer window and get the
grab device from there.

https://bugzilla.gnome.org/show_bug.cgi?id=748951
2015-06-10 11:28:32 +08:00
Jonas Ådahl
9e464252c0 wayland: Don't try to guess the popup menu placement when it was set
If a position was already explicitly set, don't try to guess the
position of popup menus by looking at the pointer position, just use
the set coordinates.

https://bugzilla.gnome.org/show_bug.cgi?id=748951
2015-06-10 11:28:32 +08:00
Jonas Ådahl
0f47d1bac4 wayland: Position popups relative to the parent surface
According to the xdg-shell protocol specification the (x, y) coordinates
passed when creating a popup surface is relative to top left corner of
the parent surface, but prior to this patch, if the parent surface
was an xdg_surface, we'd position it relative to top left corner of the
window geometry of that xdg_surface.

https://bugzilla.gnome.org/show_bug.cgi?id=749717
2015-06-10 10:50:12 +08:00
William Hua
d37f94a524 mir: keep reference on queued events 2015-06-02 15:14:27 -04:00