Commit Graph

7055 Commits

Author SHA1 Message Date
Jonas Ådahl
74d237df41 wayland: Use helper to translate to real parent window geometry
Use a helper to translate a coordinate from non-real GdkWindow parent
to window geometry coordinate space of the real GdkWindow parent,
meaning the coordinate space of the GdkWindow of the parent used as a
xdg_popup parent where (0, 0) is inside of the shadow margin.

https://bugzilla.gnome.org/show_bug.cgi?id=771117
2016-09-14 11:29:32 +08:00
Jonas Ådahl
bc6630bb7d wayland: Don't pass parent when creating dynamic positioner
When using the dynamic positioner (i.e. positioning from move_to_rect)
we can always rely on having a proper transient-for to position
relative to, so lets drop the ignored parameter.

https://bugzilla.gnome.org/show_bug.cgi?id=771117
2016-09-14 11:29:32 +08:00
Jonas Ådahl
9a2ce3a485 wayland: Don't pass transient-for when getting real parent
It's always derived from transient-for so no need to pass it.

https://bugzilla.gnome.org/show_bug.cgi?id=771117
2016-09-14 11:29:32 +08:00
Jonas Ådahl
50e33308db wayland: Fix south-west anchor rect calculation
https://bugzilla.gnome.org/show_bug.cgi?id=771117
2016-09-14 11:29:32 +08:00
Jonas Ådahl
4d2c0a843a wayland: Don't pass non-changing state when calculating popup rects
https://bugzilla.gnome.org/show_bug.cgi?id=771117
2016-09-14 11:29:32 +08:00
Jonas Ådahl
e656a14764 wayland: Move move_to_rect related code closer together
Move the code used for calculating the result of move_to_rect
(final_rect, flipped_rect etc) closer to the other move_to_rect
functions (i.e. next to create_dynamic_positioner), and let the
xdg_popup configure handler just call the calculation function.

https://bugzilla.gnome.org/show_bug.cgi?id=771117
2016-09-14 11:29:32 +08:00
Olivier Fourdan
eb17ee1c26 wayland: unmap popup along with its toplevel
If an application umaps the toplevel from its popup callback, this can
lead to a protocol error.

Make sure we mark popup parent and use that to check if their parent is
the toplevel being unmapped in which case we shall unmap the popup first
to avoid the protocol error.

Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=770906
2016-09-12 10:03:58 +02:00
Takao Fujiwara
f2ba6ca473 gdkscreen-x11: Enable RandR on VirtualBox
RandR 1.5 is enabled on VirtualBox guest of Fedora 25 but
XRROutputInfo->name is "default". If init_randr15() does not
return TRUE, the monitor size sets 0 because gdk_screen_get_width()
returns 0.

This problem causes GtkStatusIcon not to show the activate menu.

https://bugzilla.gnome.org/show_bug.cgi?id=771033
2016-09-09 16:41:23 -04:00
Timm Bäder
fbca09ecb4 gdkdisplay: Unref seats in finalize 2016-09-08 11:34:13 +02:00
Timm Bäder
476c1c44a5 gdkdisplay-wayland: Fix some memory leaks 2016-09-08 11:34:13 +02:00
Jonas Ådahl
98b0f78200 wayland: Warn when an application tries to map popup incorrectly
When a popup is mapped but will not be the top most popup (for example
the parent is not the current top most popup, or if there already is a
popup mapped but the parent is a toplevel), warn and ignore it instead
of continuing, as continuing would be a protocol violation.

https://bugzilla.gnome.org/show_bug.cgi?id=770745
2016-09-02 18:56:03 +08:00
Matthias Clasen
c9749ad7dc x11: Fix a trap mixup
There was a return between a push/pop of an error trap, and
this managed to trigger the 'unpopped trap' warning in the
displayclose test now. Fix this.
2016-08-29 15:51:05 -04:00
Matthias Clasen
bdbe2de57d Document handle-related Wayland api
In particular, note that this API depends on an unstable
Wayland protocol and thus may have to change.
2016-08-29 13:20:44 -04:00
Jonas Ådahl
340b5964dd wayland: Add API for setting an exported as a parent
Add an API that enables an application to, given an exported window
handle, set its own window as a transient of the window associated with
the exported window handle.

https://bugzilla.gnome.org/show_bug.cgi?id=769788
2016-08-29 13:20:44 -04:00
Jonas Ådahl
127d2ac956 wayland: Add API for creating exported window handles
Using the xdg_foreign protocol, expose a way to get handles to windows
that may be shared between processes.

https://bugzilla.gnome.org/show_bug.cgi?id=769788
2016-08-29 13:20:44 -04:00
Руслан Ижбулатов
b05ed13710 GDK W32: Remove obsolete assertions 2016-08-26 20:46:27 +00:00
Olivier Fourdan
9f57fe9960 wayland: add min/max size from xdg-shell v6
Bugzilla: https://bugzilla.gnome.org/show_bug.cgi?id=764413
2016-08-25 11:04:16 +02:00
Jonas Ådahl
b7964cf5a7 wayland: Implement move_to_rect
Translate move_to_rect parameter into xdg_positioner requests, and use
the generated xdg_positioner to create the popup.

https://bugzilla.gnome.org/show_bug.cgi?id=769937
2016-08-25 12:31:40 +08:00
Jonas Ådahl
ceada4adc2 wayland: Port to xdg_shell unstable v6
https://bugzilla.gnome.org/show_bug.cgi?id=769937
2016-08-25 12:31:40 +08:00
Jonas Ådahl
643f033923 wayland: Move window geometry calculation to helper
We'll use it from more places later.

https://bugzilla.gnome.org/show_bug.cgi?id=769937
2016-08-25 12:31:40 +08:00
Jonas Ådahl
d2a80cd235 wayland: Only update the window title if it actually updated
This makes the protocol log less spammy.

https://bugzilla.gnome.org/show_bug.cgi?id=769937
2016-08-25 12:31:40 +08:00
Jonas Ådahl
8270699119 wayland: Only sync surface regions once per commit
Only set input, opaque and window geometry regions once per commit.
They are double buffered anyway, so the last one would only take effect
either way; this way reading protocol logs are much more pleasent.

https://bugzilla.gnome.org/show_bug.cgi?id=769937
2016-08-25 12:31:40 +08:00
Jonas Ådahl
d2385bec09 wayland: Remove gdk_wayland_display_get_xdg_shell()
Don't expose the xdg_shell struct as it is not yet a stable type that
will stay the same.

https://bugzilla.gnome.org/show_bug.cgi?id=769937
2016-08-25 12:31:40 +08:00
Jonas Ådahl
e53d381430 wayland: Get tiled state from gtk_shell instead of xdg_shell
Use our the 'tiled' entry from our new 'state' enum sent via
xdg_surface.configure.

https://bugzilla.gnome.org/show_bug.cgi?id=769937
2016-08-25 12:31:40 +08:00
Jonas Ådahl
80dd7566d5 wayland: Fix indentation
https://bugzilla.gnome.org/show_bug.cgi?id=769937
2016-08-25 12:31:40 +08:00
Matthias Clasen
b8f464e102 wayland: Add some more debug spew 2016-08-25 00:13:13 -04:00
Matthias Clasen
ae720784d9 wayland: Replace g_debug by GDK_NOTE
We have this framework, lets use it.
2016-08-25 00:05:49 -04:00
Matthias Clasen
f66a76d998 Document window-icon related api as 'may not work'
Some platforms simply don't have window icons (such as Wayland).
2016-08-24 14:43:58 -04:00
Carlos Garnacho
87af999b5d wayland: Offer wayland-specific method to set pad actions feedback
The wayland tablet protocol allows notifying the compositor with
descriptions of the actions performed by each tablet element. This
API call allows to hook up in to this wayland-specific feature.

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-23 21:01:45 +02:00
Carlos Garnacho
27f879b835 wayland: Support pad devices in gdk_wayland_device_get_node_path()
We can return the node path on those too, so do that.

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-23 21:01:45 +02:00
Carlos Garnacho
7e961b8bcc wayland: Implement pad event emission
We now send all the set of button/ring/strip/group_mode events.

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-23 21:01:45 +02:00
Carlos Garnacho
cca51b71cb wayland: Create/expose pad devices
These devices are kind of an strange case. Their "master" device is
the keyboard, because they share toplevel focus with it, regardless
of stylus focus. Nonetheless, they are only expected to send the
GdkEventPad* set of events.

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-23 21:01:45 +02:00
Carlos Garnacho
82a46faf41 wayland: Add GdkWaylandDevicePad
This is a subclass of GdkWaylandDevice that implements GdkDevicePad,
all pad features are looked up from the info obtained through the
tablet v2 interface.

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-23 21:01:45 +02:00
Carlos Garnacho
feb09e384c wayland: Implement backbone of pad support
All pad interfaces and features are poked, we just now need
exposing those.

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-23 21:01:45 +02:00
Carlos Garnacho
b8a77d4da3 gdk: Add GdkDevicePad
This is an interface meant to be implemented by the "pad" devices.
This device-specific interface exposes the mapping of all pad features,
it allows retrieving:
- The number of buttons/rings/strips
- The number of groups
- The number of modes a group has
- Whether a given button/ring/strip belongs to a given group

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-23 21:01:44 +02:00
Carlos Garnacho
f1a9cd466e gdk: Address pad events similarly to keyboard events
We want the same treatment for those, the event will be emitted on the
toplevel, which will then decide what to do with the event.

It just doesn't make much sense to propagate those up/down the hierarchy,
when we want specifically one action being triggered from those.

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-23 21:01:44 +02:00
Carlos Garnacho
0dcb9b316e gdk: Add pad event structs, enum values, and event mask bit
GDK_PAD_BUTTON*,RING and STRIP will be emitted respectively when
pad buttons, rings or strips are interacted with. Each of those
pad components belong to a group (a pad can contain several of
those), which may be in a given mode. All this information is
contained in the event.

GDK_PAD_GROUP_MODE is emitted when a group in the pad switches
mode, which will generally result in a different set of actions
being triggered from the same buttons/rings/strips in the group.

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-23 21:01:44 +02:00
Carlos Garnacho
3f56af3738 gdkdevice: Add GDK_SOURCE_TABLET_PAD input source type for GdkDevices
This will represent a tablet pad.

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-23 21:01:44 +02:00
Carlos Garnacho
3ac56e60c7 wayland: Add wayland-specific method to retrieve a device node path
This will be useful at least for g-c-c, in order to match libwacom
data with GdkDevices.

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-23 21:01:44 +02:00
Carlos Garnacho
942d144d3b gdk: Pass hardware ID on gdk_device_tool_new()
And implement this on wayland, where this information is already obtained.

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-23 21:01:44 +02:00
Carlos Garnacho
40f75e74be gdk: Add a getter for the hardware id of a GdkDeviceTool
Although scarcely used, this information may be useful to retrieve
from the windowing systems that offer this information.

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-23 21:01:44 +02:00
Emmanuele Bassi
74bd3f3810 quartz: Fix typo that broke debug builds 2016-08-22 09:23:02 +01:00
Carlos Garnacho
e3bbeb48bd gdk: Fix gdk_device_tool_get_serial() return value
This is a guint64, not just a guint.

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-19 23:56:58 -04:00
Carlos Garnacho
7e11fcaa18 gdk: Fix GdkDevice::tool-changed signal marshaller
GdkDeviceTool is an object, not a boxed type.

https://bugzilla.gnome.org/show_bug.cgi?id=770026
2016-08-19 23:56:58 -04:00
Руслан Ижбулатов
09004b51a9 Update GTK+ Windows icon (now scles up to 256x256)
Also add the SVG file that was used to produce it (derived
from the old raster logo).

https://bugzilla.gnome.org/show_bug.cgi?id=768081
2016-08-19 23:55:19 -04:00
Olivier Fourdan
f9b91197c0 wayland: Use keyboard serial for implicit grab
An xdg-popup requires a serial that the compositor will compare against
its own serial and will dismiss the popup if it doesn't match.

gtk+ uses either a pointer or touch serial for its helper function
_gdk_wayland_seat_get_last_implicit_grab_serial() but if the menu is
triggered before the user has had any pointer or touch interaction with
the client, using a keyboard shortcut, there is neither pointer nor
touch serial available, and gtk+ will use 0 as the default.

As a result, the compositor will instantly dismiss the xdg-popup. In
this case, gtk+ should use the keyboard serial instead.

Track keyboard serial as well and use the keyboard serial as the value
if there is no newer pointer or touch serial available.

https://bugzilla.gnome.org/show_bug.cgi?id=768017
2016-08-19 23:50:14 -04:00
Matthias Clasen
967e2e0cd3 Minor doc cleanup
gtk-doc is smart about plural links, nowadays.
2016-08-19 23:24:47 -04:00
Matthias Clasen
88248e34b1 Remove an outdated comment
It described as TODO what the code right below it already does.
2016-08-19 23:24:08 -04:00
Jonas Ådahl
cc019de6a5 wayland: Postpone processing move_to_rect params until showing
At the time of move_to_rect() is called, not all state may have been set
up on the impl gdk window, causing the position to sometimes be
slightly offset due to drap shadow margins. For now, work around this
by postponing the processing of the move_to_rect() parameters until
showing, when its more likely that all state (such as shadow margin)
has been set correctly.

https://bugzilla.gnome.org/show_bug.cgi?id=769402
2016-08-18 04:52:03 -04:00
Jonas Ådahl
f6929cfef8 gdkwindow: Use toplevel for getting root cords in move_to_rect()
The Wayland backend manages a set of fake root coordinate spaces, where
each non-relative positioned toplevel (i.e. not popups, popovers,
tooltips etc) make up the basis of separate fake root coordinate spaces.

This means that the Wayland backend doesn't have the abilitiy get a
proper root coordinate when querying on a non-toplevel GdkWindow. To
avoid this issue, first find the toplevel, while translating the anchor
rect coordinates so that they are in the toplevel window coordinate
space. Then use this toplevel to translate the coordinates to root
window coordinate space.

https://bugzilla.gnome.org/show_bug.cgi?id=769402
2016-08-18 04:51:57 -04:00