Commit Graph

7706 Commits

Author SHA1 Message Date
Steven Calwas
86d38e6ae2 Fix window unresponsive to mouse after app-switch w/drawing tablet
Partially fixes issue #2191 regarding switching to another app while
hovering a stylus over a drawing tablet causes subsequent mouse
clicks in the app to be ignored. I was not able to reproduce the
other behavior described in #2191 concerning tiling a window.
2021-03-05 14:37:29 -05:00
Matthias Clasen
94befed65f Merge branch 'issue1549' into 'gtk-3-24'
Handle Wintab cursors that are recognized after GDK app init

See merge request GNOME/gtk!2458
2021-03-05 18:53:42 +00:00
Luca Bacci
fa2ae10599
Fix leak of event structures
Inside generate_button_event, if _gdk_input_ignore_core is > 0 we
leak an event structure. Fix that.
2021-03-01 10:51:38 +01:00
Sebastian Dröge
ac69c05a31 Use the proper cairo.Format type instead of overriding to gint via annotations in gdk_window_create_similar_surface() 2021-02-20 12:43:53 +02:00
Carlos Garnacho
4d30400987 gdk/wayland: Look for font settings recursively
Use the infrastructure already available to look up keys, instead.
This does the right thing and looks up the setting across all
sources.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/3680
2021-02-18 16:51:28 +01:00
Robert Mader
d3316a37ed wayland/window: Add API to add extra surfaces for frame callbacks
This is useful when clients use subsurfaces independently of GDK.
For example if a client creates a subsurface that covers a GdkWindow
entirely. If this subsurface is opaque, Wayland compositors may not
emit callbacks for the surface of the GdkWindow any more.
Adding the covering subsurface via this new API ensures the
GdkWindow will continue to update in this case.
2021-02-12 13:18:29 +01:00
Jonas Ådahl
ddb9bae3d4 Merge branch 'gtk-surface-release-3-24' into 'gtk-3-24'
Support gtk-shell surface release destructor

See merge request GNOME/gtk!2074
2021-01-29 16:21:09 +00:00
Matthias Clasen
a8c12a4c96 Merge branch 'gtk-3-24' into 'gtk-3-24'
Adds support for Android/Chrome on-screen keyboard

See merge request GNOME/gtk!3130
2021-01-29 00:59:15 +00:00
Maxim Zakharov
b31a80cd64 Adds support for Android/Chrome on-screen keyboard
Adds event listener for input events; converts input data into
key press and key release commands depending on inputType of the event.
2021-01-29 11:23:51 +11:00
Carlos Garnacho
02a02fac56 gdk/wayland: Mark matched settings from the portal as valid
Commit e6209de962 added some checks on TranslationEntry.valid in
order to figure out whether using the new font settings or the
old g-s-d ones. However that's only set in the non-sandboxed case.

This makes sandboxed applications fallback to the old (and also
non-existing with modern g-s-d) settings, possibly resulting in
ugly defaults being picked.

Fix this by also marking TranslationEntry elements as valid when
using the settings portal, precisely those entries that we are able
to read and match with our own table.
2021-01-14 16:09:27 +01:00
Carlos Garnacho
7ab4c9a68b Merge branch 'fix-tablet-3.24' into 'gtk-3-24'
Wayland: Fix segfault when receiving tablet/touch events for surfaces that have already been destroyed client-side

See merge request GNOME/gtk!2809
2021-01-10 13:18:15 +00:00
wisp3rwind
19a740e277 Wayland: ignore touch/tablet events on destroyed surfaces
When destroying a wl_surface (e.g. when a window or menu is closed), the
surface may continue to exist in the compositor slightly longer than on
the client side. In that case, the surface can still receive input
events, which need to be ignored gracefully.
In particular, this prevents segfaulting on wl_surface_get_user_data()
in that situation.

Reported in
https://gitlab.gnome.org/GNOME/gtk/-/issues/3296

The same issue for pointers/keyboards was reported in
https://bugzilla.gnome.org/show_bug.cgi?id=693338

and fixed with in
bfd7137ffb
3625f17857
a8fc099a72
2021-01-10 12:00:28 +01:00
Carlos Garnacho
cae5e60113 Merge branch 'avoid-pointer-reset' into 'gtk-3-24'
wayland: avoid set_cursor() when unchanged or invisible

See merge request GNOME/gtk!2822
2021-01-06 19:53:30 +00:00
Matthias Clasen
c87b21351c Merge branch 'workaround-win32-intel-blit' into 'gtk-3-24'
gdkglcontext-win32.c: Workaround Intel glBlitFramebuffer() issues

See merge request GNOME/gtk!2996
2021-01-06 16:13:02 +00:00
Chun-wei Fan
79e512ab0b gdkglcontext-win32.c: Workaround Intel glBlitFramebuffer() issues
Intel OpenGL drivers have an issue where the results of a series of
glBlitFramebuffer() can delay updating the display, when we use GDK_GL=always,
which is manifested when attempting to enter text in text boxes.

This attempts to work around this issue by requiring a glFlush() call and a
retry to the same glBlitFramebuffer() calls to avoid delays in keystrokes when
using GDK_GL=always and when not using libANGLE OpenGL/ES emulation, when an
Intel OpenGL driver is being used.

Special thanks to Lukas K. for the analysis and coming up with a workaround,
which this patch builds upon.

Fixes issue 3487
2020-12-23 19:01:31 +08:00
Maxim Zakharov
ba845fa7b2 fix touchscreen events processing in broadway.js
Makes event listeners active explicitly if supported; corrects
handling for deleted surfaces preventing javascript errors in
accessing deleted objects; makes event identifiers unique for
broadwayd when executing in Chrome on Android.

Partially fixes #1493
2020-12-18 12:22:47 +11:00
Adrien Plazas
c4f8eb7ec9 gdkpixbuf-drawable: Free the pixbuf on Cairo error
This avoids leaking the pixbuf.
2020-12-14 16:18:45 +01:00
wisp3rwind
cf7f7df10c wayland: avoid set_cursor() when unchanged or invisible
In pointer_surface_update_scale(), only rescale the cursor surface when
the scale has actually changed and the cursor is on at least one output.

fixes https://gitlab.gnome.org/GNOME/gtk/-/issues/3350

Right now, this issue is not completely understood, so it might also
involve some questionable handling of cursor surface by sway/wlroots.

However, irrespective of that issue, this patch avoids unnecessary calls to the
compositor, and there should be no drawback: Whenever the pointer enters
a new output, pointer_surface_update_scale() will be called again, such
that correct scaling of the cursor is still ensured.

There is a slight difference: When the cursor leaves the last output,
previously the image was reset to scale factor 1. Now, it keeps whatever
was last. That might be more sensible than the previous behaviour,
assuming that it's likely that when the cursor enter an output again, it
has the same scaling. Alternatively, if one cares about resource usage
at this level, it might make more sense to destroy the surface then
rescaling to 1.
2020-11-13 16:20:02 +01:00
Jonas Ådahl
ba31560970 wayland: Bail loudly if invalid geometry is set
There is some bug somewhere where the geometry ends up being correct.
Mutter didn't handle this gracefully, and is to be changed to simply
respect the protocol and error out the client that sends bogus data.

Prepare for this by instead of sending bogus data, complain loudly if it
would happen dropping the invalid geometry on the floor instead of
sending it.

Related: https://gitlab.gnome.org/GNOME/mutter/-/issues/1527
2020-11-11 10:17:59 +01:00
kai-berlin
bd4b55ddbf broadway: Set modifier state of scroll events
Set modifier state of scroll events, so Ctrl-scroll
works.

Fixes: #2733
2020-11-03 19:43:21 -05:00
Sam Bazley
a91de44755 gdk: Fix parent relative background crash
When setting a window's background to ParentRelative on X11, the window
depths must match to avoid a BadMatch error. Query the X server for the
parent window rather that relying on the parent passed to
gtk_window_new() to prevent crashes with reparented windows.

Fixes: #3288
2020-10-27 18:29:21 +00:00
John Ralls
d0b09a8823 [imquartz] Set the filter key to passthrough regardless of selector.
Remove all of the selectors. They just set the passthrough anyway so
there's not much point to maintaining them and they weren't the
complete set of possible selectors.
2020-10-13 14:36:12 -07:00
LRN
69b43edd55 Merge branch 'w32-transient-ordering-rollback' into 'gtk-3-24'
GDK W32: transient Z-order rollback

See merge request GNOME/gtk!1769
2020-10-08 05:16:11 +00:00
Matthias Clasen
88e8a5272e Merge branch 'cursor-docs' into 'gtk-3-24'
gdkcursor: Add annotations for gdk_cursor_new_for_display()

See merge request GNOME/gtk!2640
2020-09-29 13:32:36 +00:00
Philip Withnall
4d5368e56e gdkcursor: Add annotations for gdk_cursor_new_for_display()
It can fail on Wayland, and is also (transfer full).

Signed-off-by: Philip Withnall <pwithnall@endlessos.org>
2020-09-29 14:05:38 +01:00
Robert Mader
5bd8f8c5a3 gdk/wayland: Add support for primary-selection-unstable-v1
Additionally to gtk_primary_selection, the gtk-private predecessor,
support the upstream unstable protocol.

This allows the primary selection to work on Kwin and potentially
other compositors, as well as dropping the private version eventually.

Closes https://gitlab.gnome.org/GNOME/gtk/-/issues/2591
2020-09-27 13:40:40 +02:00
Jonas Ådahl
a184b5bf51 wayland: Emit dummy configure event when resizing while fixed
When a fixed size is active (e.g. the window is maximized),
gtk_window_resize() shouldn't take immediate effect, so the request was
dropped. This made GTK unhappy if this happened, it will freeze updating
the window until it received the new size it demanded.

Handle this by being nice and emitting a dummy GDK_CONFIGURE event with
the old size where we previously ignored it. It won't resize the window
immediately, so it shouldn't have a visible effect, and the size GTK
requested is still saved away for when the window is unmaximized, but
emitting the event will make GTK receive the event it expects.

We still drop the request on the floor, e.g. if we still haven't seen
the initial configuration, just as we do when actually doing the resize.

Closes: https://gitlab.gnome.org/GNOME/gtk/-/issues/2907
2020-09-07 17:57:32 +02:00
Carlos Garnacho
a98001978c gdk: Keep a reference on the last source device
This device may go away, which means we have a pointer to a possibly
stale object. Keep a reference here, and let future events bring this
accounting up-to-date when the mouse pointer is next updated via other
device.

Fixes: https://gitlab.gnome.org/GNOME/gtk/-/issues/855
2020-08-31 15:43:54 +02:00
Julien Ropé
f26c026aaf Fix resource leak in gdk_display_close() under Wayland
When using the gdk_display_close(), the handle to the Wayland compositor was not released.
This could cause the consumption of all available handles, preventing other processes from accessing the display.

Fixing this by calling wl_display_disconnect() when releasing the GdkWaylandDisplay object.

Signed-off-by: Julien Ropé <jrope@redhat.com>
2020-08-31 14:01:38 +02:00
Matthias Clasen
3795d0ad8c Merge branch 'wip/exalm/hotspot-fix-324' into 'gtk-3-24'
wayland: Fix dnd hotspot movement

See merge request GNOME/gtk!2491
2020-08-26 23:48:48 +00:00
Alexander Mikhaylenko
c67e3f37da wayland: Fix dnd hotspot movement
_gdk_wayland_window_offset_next_wl_buffer() moves the window relatively to
its current position, pass it a delta instead of new position.
2020-08-27 04:02:24 +05:00
Carlos Garnacho
b1bbb37154 gdk/wayland: Use double-click/drag-threshold settings from g-d-s
Handle both these settings, and the older settings-daemon ones for
backwards compatibility. The keys are already checked for existence
in the schema, so it will just use the existing ones.
2020-08-27 00:30:51 +02:00
Carlos Garnacho
e6209de962 gdk/wayland: Look for font settings in gsettings-desktop-schemas
Prefer this location, but also look for the old location in
settings-daemon for backwards compatibility. This applies to both
direct settings lookups and via the settings portal.
2020-08-27 00:30:38 +02:00
Steven Calwas
4c10134295 Handle Wintab cursors that are recognized after GDK app init
Previously, a GDK application handled the Wintab cursors (stylus,
eraser, etc.) only during app initialization. If new cursors were
recognized by Wintab during app execution, the app would not know
about them.

This fix still handles Wintab cursors known during app initialization.
In addition, when Wintab recognizes new cursors and notifies the app
via a WT_CSRCHANGE message, the app handles the new cursors, creating
new Wintab device objects for them.

Closes #1549
2020-08-20 22:54:36 -07:00
John Ralls
69135bcfe3 Accommodate macOS 11.0 Big Sur in gdk_quartz_osx_version.
This may need to be changed next year, it depends on what Apple
decides to do with version numbers going forward.

Also updated GdkOSXVersion to include Catalina and Big Sur.
2020-08-11 17:08:53 -07:00
Chun-wei Fan
0cbeee3857 Merge branch 'move-msvc-projects' into 'gtk-3-24'
Visual Studio projects: move projects to win32/

See merge request GNOME/gtk!2248
2020-07-24 02:43:18 +00:00
Chun-wei Fan
2dca4e310d Merge branch 'gtk3.win.egl.unfullscreen' into 'gtk-3-24'
gdkwindow-win32.c: Fix GLES glitches during un-fullscreen

See merge request GNOME/gtk!645
2020-07-24 02:39:25 +00:00
Chun-wei Fan
844555384b Merge branch 'gles-windows-arm64' into 'gtk-3-24'
GDK/Win32: Force GLES if running on ARM64

See merge request GNOME/gtk!827
2020-07-24 02:37:33 +00:00
Chun-wei Fan
522e5d4fa5 Merge branch 'win32-native-input' into 'gtk-3-24'
Use native Windows API for converting keystrokes to characters

See merge request GNOME/gtk!991
2020-07-24 02:27:41 +00:00
Ian Douglas Scott
72d80b8002 gdk: update gdkkeysyms.h with ./gdkkeysyms-update.pl script
There is a default keybinding set with `XF86Keyboard`, but GTK isn't
aware of this keysym. This adds it, as well as a couple others.

See 751e44568c
2020-07-21 13:22:04 -07:00
Philip Zander
5b81864211 Fix 2 warnings, formatting 2020-07-16 15:44:08 +02:00
Philip Zander
9bf9c76365 Remove VK_PACKET handling code that has become unnecessary 2020-07-16 15:01:50 +02:00
Philip Zander
5413892b7d Formatting 2020-07-16 15:01:50 +02:00
Philip Zander
e6f05da6ef Use native Windows API for converting keystrokes to characters
Instead of using the incomplete GTK-internal emulation, use the WM_CHAR
messages sent by Windows. Make the IME input method the default for all
languages on Windows.
2020-07-16 15:01:47 +02:00
Chun-wei Fan
1feb169bfa Visual Studio projects: move projects to win32/
This will simplify our source tree a bit
2020-07-16 18:57:03 +08:00
Christian Rauch
8e99b3f079 wayland: prefer a manually requested size over the configure hint
When a window receives a resize request, it might ignore this new size and
use the compositor's size hints instead to restore to floating mode.

This commit changes that behaviour in that a window will always prefer
the manually resized dimensions over the compositor's hint.
2020-07-15 16:14:25 +01:00
Emmanuele Bassi
e0da315783 Merge branch 'wip/mbiggio/quartz-device-axes-reset' into 'gtk-3-24'
quartz: mimic source device axes

See merge request GNOME/gtk!2208
2020-07-10 15:48:18 +00:00
Simon McVittie
b4d120fcb4 build: Don't export GResource-related symbols with newer GLib
This makes the desired behaviour explicit, and matches the behaviour
seen with Meson, where "external : false" is the default.

Before GNOME/glib!1468, not passing --internal to the resource compiler
meant "no special export attribute, do what you would normally do",
so these symbols were not exported due to our global use of
-fvisibility=hidden.

However, since GNOME/glib!1468, not passing --internal to the resource
compiler results in the symbols being decorated with G_MODULE_EXPORT,
which overrides -fvisibility=hidden. This was necessary because Windows
DLLs normally behave a bit like the equivalent of ELF libraries with
-fvisibility=hidden.

Signed-off-by: Simon McVittie <smcv@debian.org>
Resolves: https://gitlab.gnome.org/GNOME/gtk/-/issues/2919
2020-07-09 16:57:42 +01:00
Biggio
4b953dee70 quartz: mimic source device axes
Input devices such as stylus pens have additional axes besides (x,y)
coordinates. In order for these devices to work properly, their additional
axes need to be mimicked from the physical device to the associated
virtual pointer when they become active.
2020-07-08 15:26:06 +02:00
Caolán McNamara
2b74662b2b gtk#767 add a way to change the application_id of a toplevel wayland GdkSurface
so LibreOffice can reuse toplevels and get the right task icons

references;
 https://gitlab.gnome.org/GNOME/gtk/-/issues/767
 https://lists.freedesktop.org/archives/wayland-devel/2019-July/040704.html
 e0d6ad1d5e
 https://bugs.documentfoundation.org/show_bug.cgi?id=125934
 https://bugzilla.redhat.com/show_bug.cgi?id=1334915
 https://bugreports.qt.io/browse/QTBUG-77182
2020-07-07 21:14:21 +01:00