Commit Graph

8852 Commits

Author SHA1 Message Date
Matthias Clasen
814d20d61a docs: Small clarifications to DND docs
Clear up the documentation around ASK handling
a bit.
2020-01-04 12:48:39 -05:00
Matthias Clasen
6cef520804 wayland: Minor cleanup
Stop storing selected_action, mainly since the name
is confusing. Instead, just pass the value directly
in the 2 places where it is used.
2020-01-04 12:48:39 -05:00
Matthias Clasen
8c77491150 wayland: Fix action handling more
When updating GdkDrop::actions from changes sent by
the compositor, we were inadvertently setting them to 0,
causing drops to appear impossible.
2020-01-04 09:38:31 -05:00
Matthias Clasen
709ebcedd4 wayland: Finish pending offer handling
When creating a new GdkDrop object on drag_enter, take pending
source_actions and action into account. The code to store the
pending actions was already there, they were just not passed
on to the drop object when we create it.
2020-01-04 09:38:01 -05:00
Matthias Clasen
47e6b88555 wayland: Clean up drags
We need to set the drag to NULL in gdk_wayland_drag_drop_done,
otherwise, all future drags will be considered local after the
first local one. Worse, they will also provide the wrong data.
2020-01-04 09:36:38 -05:00
Matthias Clasen
4b818495ca wayland: Fix dnd type negotiation
We need to call gdk_content_formats_union_serialize_mime_types
like GdkClipboard does, in order to get mime types that we can
sent out.
2020-01-01 12:51:19 -05:00
Matthias Clasen
1841ec4f8e contentprovider: cosmetic fix 2020-01-01 12:51:19 -05:00
Matthias Clasen
21708e4352 contentserializer: Fix an annotation 2020-01-01 12:51:19 -05:00
Matthias Clasen
15242d66e1 wayland: Pass root coordinates for dnd events
That is what the api currently requires, so provide it.

This fixes DND to work again, for the most part.
2019-12-30 12:00:53 -05:00
Matthias Clasen
94a0bc01f9 gdk: Populate dnd event coords
The GdkDrop emit... apis take root coordinates.
That should be changed to surface coordinates,
eventually. For now, make the functions fill
the x, y fields.
2019-12-30 11:58:11 -05:00
Matthias Clasen
677c4b140c gdk: Fix coordinates in dnd events
Don't store coordinates as shorts. Use doubles,
as everywhere else. Also add x, y in addition
to x_root, y_root, and actually return those
in gdk_event_get_coords.
2019-12-30 11:56:49 -05:00
Matthias Clasen
0bb9fc65ad Remove gdk_seat_grab
We are no longer using free-standing grabs
in GTK. The replacement is the autohide
functionality of popup surfaces.
2019-12-29 20:31:58 -05:00
Matthias Clasen
ad6fe9d6a0 surface: Only unpause events if we paused them
When a new popup surface is created, it may end up
getting a resume-events signal from its frame clock
without having seen a flush-events first.

Don't unpause events in that case, since it messes
up the displays pause counter.

This was causing criticals with tooltips.
2019-12-29 13:35:36 -05:00
Matthias Clasen
a73947e54f Remove more mir remnants
The mir backend was removed a while ago, so
GDK_WINDOWING_MIR is never defined.
2019-12-28 21:52:34 -05:00
Matthias Clasen
0546fd7c8a Merge branch 'fix.nonunix.builds' into 'master'
Fix non-portal (UNIX) builds

See merge request GNOME/gtk!1252
2019-12-16 17:38:56 +00:00
Chun-wei Fan
3d8d4921af gdk: Build portal bits on *nix only
The newly-added portal items are supported on *nix only, so only build
them on *nix.
2019-12-17 00:52:18 +08:00
Matthias Clasen
721595edea file transfer: Fix build on non-Linux
O_PATH and O_CLOEXEC are not universally available.
2019-12-16 11:38:04 -05:00
Matthias Clasen
bf2c29a36a x11: Only update cursors if we have any
We were accessing an on-demand created hash table
without checking if it had been created first.

Fixes: https://gitlab.gnome.org/GNOME/gtk/issues/2308
2019-12-13 14:46:00 -05:00
Matthias Clasen
a20c8af678 clipboard: file transfer portal support
Implement file-list <-> application/vnd.flatpak.file-list
serialization by talking to the file transfer portal.

See https://github.com/flatpak/xdg-desktop-portal/pull/222
2019-12-12 14:25:33 -05:00
Christoph Reiter
88da95d921 Merge branch 'honor-hotspot-gtk4' into 'master'
gdk/x11: Honor hotspot during drag cancel animation

See merge request GNOME/gtk!1236
2019-12-11 12:59:23 +00:00
Chun-wei Fan
44f9c67466 Merge branch 'vulkan-no-layered-windows' into 'master'
Win32: Do not enable layered windows when using Vulkan

See merge request GNOME/gtk!1217
2019-12-11 06:24:49 +00:00
Robert Mader
7a46378e71 gdk/x11: Honor hotspot during drag cancel animation
Otherwise the icon "jumps" to the cursor position with its top left when
the animation starts.
This is especially visible if the dragged item is big, like when dragging
mails in Thunderbird.
2019-12-09 01:45:30 +01:00
Hubert Figuière
585397937d doc: Cleanup doc removing mentions of gdk_surface_shape_combine_region() 2019-12-05 11:33:09 -05:00
Jonas Ådahl
ba74f41a70 wayland/vulkancontext: Fix present region on HiDPI
VkPresentRegionsKHR is expected to operate in buffer coordinates, but
the region we get passed is in surface coordinates, so it must be scaled.
2019-12-03 16:45:37 +01:00
Jonas Ådahl
d6a6313493 wayland/glcontext: Fix damage region on HiDPI
The passed regions are in surface coordinates, but
eglSwapBuffersWithDamage() is in buffer coordinates.
2019-12-03 16:45:37 +01:00
Emmanuele Bassi
def700739d Use a single compilation symbol
We use a compilation symbol in our build to allow the inclusion of
specific headers while building GTK, to avoid the need to include only
the global header.

Each namespace has its own compilation symbol because we used to have
different libraries, and strict symbol visibility between libraries;
now that we have a single library, and we can use private symbols across
namespaces while building GTK, we should have a single compilation
symbol, and simplify the build rules.
2019-11-27 13:33:43 +00:00
Chun-wei Fan
9c5ea8eba4 gdkvulkancontext-win32.c: Suppress layered Windows on Vulkan
The Vulkan renderer does not work well with layered windows enabled, so
turn it off when we successfully created the Vulkan context on Windows.
2019-11-26 17:00:11 +08:00
Emmanuele Bassi
9a88d17ef2 Merge branch 'gdk-backend-imports' into 'master'
Correct Gdk backend import paths and related gtk-doc

See merge request GNOME/gtk!1197
2019-11-18 10:27:32 +00:00
Andy Holmes
907a86fd93 Correct Gdk backend import paths and related gtk-doc
Correct the paths in the include guard warnings and use the `@Include`
directive for the Gdk backends.
2019-11-18 00:31:38 -08:00
Emmanuele Bassi
1ec4cb7f17 Disable GdkSurface.minimize on Wayland
The existing xdg-shell protocols do not support minimization in a way
that allows us to implement the GdkSurface API; the only minimization
operation does not come with a state notification, nor it comes with
a way to undo itself.

Closes: #67
2019-11-16 20:25:01 +00:00
Emmanuele Bassi
b70e4f6de9 Rename "iconify" to "minimize"
The "iconified" state is mostly an X11-ism; every other platform calls
this state "minimized" because it may not involve turning a window into
an icon at all.
2019-11-16 20:07:37 +00:00
Andy Holmes
d32cd210bb Correct GdkX11 import path in docs and include guards
Update the include directives in the documentation, as well as the
include guards in headers, to point to gdk/x11/gdkx.h.

closes #2254
2019-11-16 01:35:09 -08:00
Benjamin Otte
5d07877b35 Merge branch 'wip/sadiq/fix-leak' into 'master'
selection-output-stream-x11: Fix a memory leak

See merge request GNOME/gtk!1149
2019-11-04 17:46:28 +00:00
Benjamin Otte
4b41dd4eb1 Merge branch 'otte/for-master' into 'master'
Otte/for master

See merge request GNOME/gtk!1153
2019-11-01 14:13:28 +00:00
Benjamin Otte
41beae1956 vulkan: Add missing enum value
Also update comment to point to new header after Vulkan reorganized
their repositories.
2019-11-01 14:52:36 +01:00
Matthias Clasen
cb81a06793 wayland: Drop the keyboard settings object
It is no longer used.
2019-10-29 22:20:57 -04:00
Matthias Clasen
4d9cc483c9 wayland: Rely on server key repeat info
Using gsettings for this information does not work
in sandboxed scenarios, where settings are per-app.
Since the Wayland protocol provides this information
nowadays, just drop the old code for reading
the gsettings.
2019-10-29 21:58:45 -04:00
Mohammed Sadiq
e79d585b00 gdkselectionoutputstream-x11: Fix a memory leak 2019-10-27 14:05:46 +05:30
Carlos Garnacho
075c77325b gdk: Avoid poking possibly freed memory
The event may end up freed after delivery, ensure to keep a ref in order
to emit the matching emulated crossed event matching a proximity event.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/2157
2019-10-09 10:35:50 +02:00
Carlos Garnacho
f354a7787a gdk: Fix wl_output accounting on tablet devices
The code managing this accounting mixed seat and tablet output lists,
can't bode well. Fixes invalid reads on list elements, as there are
dangling pointers.

Closes: https://gitlab.gnome.org/GNOME/gtk/issues/2157
2019-10-08 17:59:57 +02:00
Georges Basile Stavracas Neto
a795d6635b vulkan/context: Implement VK_KHR_incremental_present
This is the Vulkan version of eglSwapBuffersWithDamage(), and
it's always a good idea to limit the number of pixels we're
pushing to the GPU and/or swapping into the display.
2019-10-05 12:13:22 -03:00
Georges Basile Stavracas Neto
a91d0ac156 wayland: Allow binding to wl_compositor v4
This is a requirement for using VK_KHR_incremental_present.
Vulkan Wayland drivers translate the VkPresentRegionsKHR to
wl_surface.damage_buffer(), which a v4-only request.
2019-10-05 12:13:22 -03:00
Georges Basile Stavracas Neto
0e55f7a52f wayland/surface: Fix crash when unexporting
This is the exact same problem of 655c9dd526.
2019-10-01 16:13:43 -03:00
Georges Basile Stavracas Neto
655c9dd526 wayland/surface: Only call destroy func when available
When calling gdk_wayland_surface_export_handle(), if we pass
some 'user_data' but no 'destroy_func', GTK4 crashes. That's
because in xdg_exported_handle() we are unconditionally calling
destroy_func -- even when it's NULL.

Fix that by checking if there's a destroy function before calling
it.

Fixes https://gitlab.gnome.org/GNOME/gtk/issues/2179
2019-10-01 11:54:28 -03:00
Timm Bäder
f0266cbef3 pixbuf: Add a missing return value transfer annotation
And add a (nullable)
2019-09-13 11:07:56 +02:00
Timm Bäder
f3099afcc5 icontheme: Return textures from load_icon{,_for_scale} 2019-09-09 17:36:26 +02:00
Timm Bäder
37f8e6aabd gdk: Add gtk_pixbuf_get_from_texture 2019-09-09 17:36:26 +02:00
Olivier Fourdan
31393704de wayland: Fix xdg-output v3 support
The xdg_output.done event is deprecated in xdg-output v3, so clients
need to rely on the wl_output.done event instead.

However, applying the changes on the fist wl_output.event when using
xdg-output v3 may lead to an incomplete change, as following xdg-output
updates may follow.

Make sure we apply xdg-output events on wl_output.done events with
xdg-output v3.

https://gitlab.gnome.org/GNOME/gtk/issues/2128
2019-09-03 16:13:24 +02:00
Дилян Палаузов
6ded38de2b Minor typos in the Documentation (a/an) 2019-08-25 12:52:46 +00:00
Matthias Clasen
4fa1f459dd Merge branch 'gdkmonitor-x11-manufacturer' into 'master'
gdk: x11: Fill GdkMonitor manufacturer with PNP id from EDID

Closes #1765

See merge request GNOME/gtk!859
2019-08-25 11:58:02 +00:00