Commit Graph

7233 Commits

Author SHA1 Message Date
Georges Basile Stavracas Neto
73155e3988 display-x11: Unset tiled state if _GTK_EDGE_CONSTRAINTS is supported
Commit c415bef5de introduced support for the new _GTK_EDGE_CONSTRAINTS
atom. If the compositor supports that atom, however, we were always
setting the tiled state, even if no actual tiling information is
available, where the correct action is to completely remove any traces
of the tiled state.

Fix that by correctly removing the tiled state when compositor supports
_GTK_EDGE_CONSTRAINTS Xatom.

https://bugzilla.gnome.org/show_bug.cgi?id=788516
2017-10-04 15:33:15 -03:00
Matthias Clasen
223a709403 wayland: Fix a typo
We were not setting the right tiling hint in some cases.

Patch by Jan Steffens.
2017-10-04 07:35:45 -04:00
Georges Basile Stavracas Neto
c415bef5de x11: Add support for _GTK_EDGE_CONSTRAINTS atom
Following the previous patch, where edge constraints support
was added to the Wayland backend, this patch introduces the
necessary code to handle the _GTK_EDGE_CONSTRAINTS atom from
X11 backend.

https://bugzilla.gnome.org/show_bug.cgi?id=783669
2017-10-03 20:06:46 -03:00
Georges Basile Stavracas Neto
3bae80dfc1 wayland: consider edge constraints in surface configuration
Now that GTK windows have the ability to properly handle
per-edge tiling constraints, this patch extends GTK's
internal Wayland protocol to have a proper enum with the
relevant edge data.

Once this approach is validated, we can think of upstreaming
this work as an official Wayland protocol extension.

https://bugzilla.gnome.org/show_bug.cgi?id=783669
2017-10-03 20:06:46 -03:00
Georges Basile Stavracas Neto
f1a3bc2f2c gdk: introduce edge constraint states
These states will be consumed by GtkWindow in order to
have better edge management on tiling situations. Their
values are supplied by the compositor, and will be send
through and X11 Atom or a Wayland protocol extension.

https://bugzilla.gnome.org/show_bug.cgi?id=783669
2017-10-03 20:06:43 -03:00
Daniel Elstner
a57630b30c gdk-wayland: Do not leak dummy 1x1 surface on every draw
When using EGL, neither leak nor re-create the dummy 1x1 Cairo
surface every time gdk_wayland_window_ensure_cairo_surface()
is called.

https://bugzilla.gnome.org/show_bug.cgi?id=775126
2017-09-26 21:15:21 +02:00
Daniel Boles
5c700cf575 gdkseatdefault: Grab touch events where applicable
gdk_seat_default_grab() grabs POINTER_EVENTS if the capability is
GDK_SEAT_CAPABILITY_ALL_POINTING. But that enumerator is a union that
includes GDK_SEAT_CAPABILITY_TOUCH, but we never grabbed TOUCH_EVENTS,
an unused macro that was presumably created with this purpose in mind.

So, check which of the ALL_POINTING capabilities we have, and set the
right mask of POINTER_EVENTS and/or TOUCH_EVENTS as required.

As part of this, explicitly let TABLET_STYLUS take over pointer events,
as this is the intended behaviour and was the effective result before.

This should fix touch events being lost in migrating from Device.grab()
to Seat.grab(GDK_SEAT_CAPABILITY_ALL_POINTING), as found by Inkscape.

https://bugzilla.gnome.org/show_bug.cgi?id=781757
2017-09-20 19:19:31 +01:00
Matthias Clasen
7b7a4bf1d0 Remove an unused field
Drag contexts are objects, so there is no need to carry a
manual refcount around.
2017-08-26 19:58:52 -04:00
Matthias Clasen
888559235f x11: Fix initial drag cursors
Under X, we were not setting the right drag cursor initially,
because at current_action == action == 0, initially. Fix this
by explicitly using the right cursor when grabbing.
2017-08-26 19:58:52 -04:00
Lionel Landwerlin
12d10f239b gdk: wayland: always set buffer scale on size update
We're only updating this when we have an EGL window. This means we
have the wrong scaling factor when using Vulkan.

https://bugzilla.gnome.org/show_bug.cgi?id=786492
2017-08-23 10:44:20 -04:00
Rui Matos
d17aeec08c gdkwindow: Avoid re-setting the opaque region if it doesn't change
This avoids, at least, needless chatter with the compositor and the X
server in X11's case.

https://bugzilla.gnome.org/show_bug.cgi?id=786469
2017-08-18 18:58:19 +02:00
Chun-wei Fan
ebadaaa3e0 GDK-Win32: Fix AeroSnap on HiDPI
Commit 1d0fad3 revealed that there were some assumptions made that were
actually to compensate for the bug fixed by that commit, so we need to
remove those assumptions as they would result in AerSnap to not work
properly on HiDPI screens.

Also re-do how we set the x and y positions of our GdkWindow, so that we
are more consistent across the board when we go between a GDK window
coordinate and a Windows API window cooredinate.

This would also simplify the code a bit.

https://bugzilla.gnome.org/show_bug.cgi?id=785999
2017-08-18 13:26:58 +08:00
Carlos Garnacho
136f43e329 gdk/x11: Extract GdkDeviceTool tool ID from "Wacom Serial IDs" property
This property contains 5 integers, of which the last 2 respectively
contain the tool serial number and tool ID. We were only extracting the
first so far, but GdkDeviceTool also has API getters for the latter,
which remained 0.

https://bugzilla.gnome.org/show_bug.cgi?id=786400
2017-08-17 16:26:12 +02:00
Daniel Boles
0721dad970 GdkDisplay: Call the correct push|pop_error_trap()
It is wrong to assume all Displays are of the same class as the default.

https://bugzilla.gnome.org/show_bug.cgi?id=784016
2017-08-15 20:34:12 +01:00
Daniel Boles
9d532da2dd gdkdisplay: Remove a pointless assignment 2017-08-06 01:12:08 +01:00
Olivier Fourdan
1c23bce350 wayland: add shortcut inhibitor support
This adds support for the shortcut inhibitor protocol in gdk/wayland
backend.

A shortcut inhibitor request is issued from the gdk wayland backend for
both the older, deprecated API gdk_device_grab() and the new gdk seat
API gdk_seat_grab(), but only if the requested capability is for the
keyboard only.

https://bugzilla.gnome.org/show_bug.cgi?id=783343
2017-08-02 12:38:52 +02:00
Carlos Garnacho
b53a6fb092 wayland: Clear tablet tool cursor on proximity out
This ensures that the tablet tool will get the cursor updated even if it
happens to fall within the same window again on the next proximity in.

https://bugzilla.gnome.org/show_bug.cgi?id=785375
2017-07-25 18:36:12 +02:00
Carlos Garnacho
18eeaf704e gdkwindow: Update cursor for tablet tools in the window
This check must be done explicitly on Wayland as the master device for
tablet tools differ from the Core Pointer. This ensures that whenever a
tablet tool is inside a window and the cursor is programmatically changed,
it will be visually updated too.

https://bugzilla.gnome.org/show_bug.cgi?id=785375
2017-07-25 18:36:12 +02:00
Carlos Garnacho
3f09833253 wayland: Observe GDK_SEAT_CAPABILITY_TABLET_STYLUS on gdk_seat_get_slaves()
This flag wasn't being honored so far...
2017-07-25 15:35:41 +02:00
Jason Gerecke
32919a4a02 wayland: Implement support for tablet wheel scrolling
Adds support for creating scroll events from Wayland tablet wheel events.
Even though no Wacom tablet puck has a smooth-scrolling wheel, both event
types need to be generated to make the upper layers happy.

https://bugzilla.gnome.org/show_bug.cgi?id=783716
2017-07-20 14:11:26 +02:00
Carlos Garnacho
e6863da8fc wayland: Make function to create scroll event more generic
Add GdkWaylandPointerData and GdkDevice arguments so it can be
used across master devices.

https://bugzilla.gnome.org/show_bug.cgi?id=783716
2017-07-20 14:11:26 +02:00
Jason Gerecke
3a83de295d wayland: Get implicit grab serial information from tablet devices
If a tablet device is used to perform actions like window moving or resizing,
GTK must provide the correct implicit grab serial number over Wayland to Mutter
in order for the action to succeed. This commit adds tablet support to the
implicit serial getters.

https://bugzilla.gnome.org/show_bug.cgi?id=777333
2017-07-20 12:23:15 +02:00
Jonas Ådahl
376ff1ae60 wayland: Throttle system bell requests
If a bad behaving application tries to make the window/display beep too
often, throttle the beep requests so that we don't end up filling the
Wayland socket queue.

The throttle is set to 50 beeps per second, which far more beeps than
will ever make any sense from a user experience point of view, but will
avoid terminating due to an excessive amount of requests.

https://bugzilla.gnome.org/show_bug.cgi?id=778188
2017-07-20 10:03:51 +08:00
Jonas Ådahl
f78585b7c3 wayland: Make beep requests go through the GdkDisplay
This way we can add things like throttling.

https://bugzilla.gnome.org/show_bug.cgi?id=778188
2017-07-20 10:03:43 +08:00
Cody Russell
68b92cc6ef Update API for El Capitan+
Use NSAnimationContext where possible.
2017-07-18 14:54:11 -04:00
Cody Russell
fc1f0b171c os x: Add new versions 2017-07-18 14:46:45 -04:00
Daniel Boles
ac21aff55b GdkRGBA: Fix typo precentage => percentage 2017-07-06 13:59:53 +01:00
Jason Gerecke
3d9a945803 x11: Assign GDK_SOURCE_TABLET_PAD when necessary
Wacom tablets often have a "pad" device which houses multiple buttons. At
present, these devices are incorrectly marked as GDK_SOURCE_PEN which can
cause problems for some software.

https://bugzilla.gnome.org/show_bug.cgi?id=782040
2017-06-30 20:41:36 +02:00
Mart Raudsepp
bb13421fd3 GdkWaylandWindow: Fix version numbers in export_handle() docs
This change appeared first in 3.22.16 release, not 3.22.13.

https://bugzilla.gnome.org/show_bug.cgi?id=782325
2017-06-22 05:39:25 +03:00
Carlos Garnacho
9e740bd435 gdk: Set vid/pid on wayland tablets
This was missed so far... Use %.4x format, in order to behave just
the same than X11.
2017-06-16 19:30:10 +02:00
Dan Torop
d9a9530f28 wayland: selectively cancel key repeat on key release
Under Wayland, when multiple keys are pressed and the user releases a
key, key repeat should continue unless the key released is the one
currently repeating.

In the case of:

- key1 press
- key1 repeat
- key2 press -> key1 repeat stopped
- key2 repeat
- key2 release

The behavior should be to cancel keyboard repeat, though key1 is still
held down. This is consistent with prior X11/XWayland behavior.

The following also must work:

- key1 press
- key2 press
- key2 release
- key2 press
- key1 release
- key2 should continue to repeat

The fix for bug #778019 should continue to work:

- key1 press
- key1 repeat
- key2 press -> key1 repeat stopped
- key1 release
- key2 should repeat

The choice to change the counter nkeys to the flag repeat_active
helps to solve the second test case.

https://bugzilla.gnome.org/show_bug.cgi?id=781285
2017-06-02 19:18:05 +02:00
Olivier Fourdan
2d41d772d7 wayland: fix xdg_surface test in move/resize drag
begin_resize_drag() and begin_move_drag() check for xdg_surface being
not null, but those apply on xdg_toplevel so they should check for
xdg_toplevel being non-null instead.

https://bugzilla.gnome.org/show_bug.cgi?id=781945
2017-06-02 15:54:50 +02:00
Olivier Fourdan
c94f40b893 wayland: check parent surface for subsurface
When an event is received while a tooltip is showing, the GtkTooltip's
event handling code can end up calling gdk_window_set_transient_for()
from gtk_tooltip_set_last_window().

The Wayland GDK backend will try to automatically create a subsurface
in gdk_wayland_window_set_transient_for() but if the parent surface is
gone meanwhile, this will will cause a crash when trying to create a
subsurface from a parent with a null surface.

Checking for the parent is not sufficient, we ought to check for the
parent surface as well to avoid the crash.

https://bugzilla.gnome.org/show_bug.cgi?id=782283
2017-06-02 15:43:34 +02:00
Olivier Fourdan
63e05158ea wayland: Do not map toplevel utility as popup
Applications can specify the type hint as utility even on toplevel
windows.

When that toplevel is also marked as a transient for another window,
GDK Wayland backend would translate that as an xdg_popup which is not
appropriate.

While utility temp windows should remain mapped as subsurfaces (such as
the ones used by treeviews), regular windows should not translate as
neither a subsurface nor an xdg_popup.

https://bugzilla.gnome.org/show_bug.cgi?id=781945
2017-06-02 15:16:13 +02:00
Debarshi Ray
bebd5020ec wayland: Don't warn if the display is lost, skip exit handlers
There is no need to have every application log a warning when the
Wayland display server goes away, and we are using _exit instead of
exit elsewhere.

This is also what the X11 backend does (see gdk_x_io_error).

https://bugzilla.gnome.org/show_bug.cgi?id=745289
2017-05-30 09:16:45 +02:00
Debarshi Ray
425e4df100 wayland: Don't abort when preparing the source if connection is lost
Aborting the application makes it look like an application bug, when
it is the expected thing to do when the Wayland display server goes
way. eg., when the user logs out. The log level is also demoted to
avoid a storm of warnings in the log from all applications whenever
this happens.

This is also what the X11 backend does (see gdk_x_io_error).

https://bugzilla.gnome.org/show_bug.cgi?id=783047
2017-05-25 11:53:15 +02:00
Jonas Ådahl
dba57db1f3 GdkWaylandWindow: Allow calling export() multiple time
Allow getting the same export handle multiple times by calling
gdk_wayland_window_export_handle() multiple times. For each time
export() is called, a unexport() must be called to unexport.

When the window is already exported, the exported callback is called
via a idle handler. If there are multiple export() calls, they are
invoked in order either when the handle is received by the display
server, or when the idle callback is invoked.

Calling unexport() will not affect future invokations of the exported
callback, unless all export() calls have their unexport() call count
matched.

https://bugzilla.gnome.org/show_bug.cgi?id=782325
2017-05-23 09:39:29 +08:00
Timm Bäder
eb8870c912 fallback-c89: Include config.h
It holds all the HAVE_<func> definitions.
2017-05-22 14:26:32 +01:00
Emmanuele Bassi
eba10161c1 build: Disable deprecation warnings in broadway
Avoid compiler warnings while building code that uses deprecated API.
2017-05-09 14:30:40 +01:00
Emmanuele Bassi
d9e0ea2905 build: Don't include the marshallers header file
We used to inject the inclusion of the generated header file into the
generated body of the marshallers source code in order to avoid compiler
warnings about missing prototypes. The glib-genmarshal utility has been
fixed in GLib to include the prototype in the generated source, so now
we're going to trip -Werror=redundant-decls.
2017-05-09 14:19:51 +01:00
Jonas Ådahl
31c72bd7df GdkWaylandWindow: Unexport when finalizing
The application might not have exported, and it'll be too late for it
at this point anyway, so lets be helpful and not leak it.

https://bugzilla.gnome.org/show_bug.cgi?id=782109
2017-05-09 10:16:32 +08:00
Jonas Ådahl
64312d79f7 wayland: Remove self assignment
Don't assign the value of a variable to itself. It was added just for
clarity, but it makes coverity complain, so remove it.

https://bugzilla.gnome.org/show_bug.cgi?id=780301
2017-05-08 17:51:41 -04:00
Jonas Ådahl
6f326a71d4 wayland: Use correct enum type and values
Use the gravity enum values when converting to gravity. It doesn't fix
anything, since the enum values were identical, but it makes a coverity
warning go away.

https://bugzilla.gnome.org/show_bug.cgi?id=780301
2017-05-08 17:51:30 -04:00
Matthias Clasen
7c66c68f48 Revert "GdkWaylandWindow: Unexport when finalizing"
This reverts commit ab4e4bd3ae.
2017-05-08 16:00:49 -04:00
Jonas Ådahl
ab4e4bd3ae GdkWaylandWindow: Unexport when finalizing
The application might not have exported, and it'll be too late for it
at this point anyway, so lets be helpful and not leak it.

https://bugzilla.gnome.org/show_bug.cgi?id=782109
2017-05-08 15:47:12 -04:00
Jonas Ådahl
e016d9a5db GdkWaylandWindow: Clear export user data when used
It was only cleared when unexported, but we could just as well clear it
when its used too.

https://bugzilla.gnome.org/show_bug.cgi?id=782109
2017-05-08 15:47:12 -04:00
Olivier Fourdan
c770b5cbbc wayland: make key event log more explicit
With Wayland, GDK_DEBUG=events would log key events but not explicitly
state whether the event is a key press or release, or if it's
originating from a key repeat.

Add some more verbosity to make sure these informations are logged on
key delivery when GDK_DEBUG is set.

https://bugzilla.gnome.org/show_bug.cgi?id=781767
2017-04-28 13:08:37 +02:00
Florian Müllner
a866937d08 gdk: Relicense translate_wm_button_layout_to_gtk()
It is generally a good idea to license individual files under the
same terms as the project license (in particular when the mismatch
boils down to having copied the wrong license header), so relicense
the code under the LGPL.

https://bugzilla.gnome.org/show_bug.cgi?id=781422
2017-04-27 21:06:15 +02:00
Matthias Clasen
991e84fe3a Fix a typo 2017-04-21 18:27:43 -04:00
John Ralls
9b5a92f5cc Save Changes Bug 781118 - gtk 3.22.12 quartz backend segfault
Calling 'width' on an NSValue won't work, must call sizeValue on it.
2017-04-10 16:40:05 -07:00