summaryrefslogtreecommitdiff
path: root/gdk/wayland/gdkdisplay-wayland.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'wip/cursor-output-scale-changes' into 'master'Matthias Clasen2018-06-291-0/+12
|\ | | | | | | | | wayland: Update cursor surface scale when output scale changes See merge request GNOME/gtk!224
| * wayland: Update cursor surface scale when output scale changesJonas Ådahl2018-06-281-0/+12
| | | | | | | | | | | | Also update the cursor surfaces of every seat when an output changes scale. This could for example happen when a monitor scale is changed via Settings.
* | Remove a lot of Since annotationsMatthias Clasen2018-06-251-2/+0
| | | | | | | | | | 4.0 will represent a clean epoch. We don't want to have lots of noise in the docs about 2.x or 3.x.
* | Merge branch 'master' into 'issue1084'Matthias Clasen2018-06-201-17/+4
|\ \ | | | | | | | | | # Conflicts: # gdk/gdk.c
| * | wayland: Use shm_open(SHM_ANON) on FreeBSDmyfreeweb2018-06-191-0/+4
| |/ | | | | This functionality is similar to Linux's memfd. It creates anonymous shared memory without touching the filesystem, which allows it to work in Capsicum capability mode (sandbox).
| * wayland: Get rid of GdkWaylandSelectionBenjamin Otte2018-06-181-17/+0
| | | | | | | | Move data source handling into the DND code instead.
* | display: Add new virtual gdk_display_get_startup_notification_id() method.Mario Sanchez Prada2018-06-111-0/+18
| | | | | | | | | | | | | | Includes implementation for Wayland and X11, which are the only backends implementing the Startup Notification Protocol, returns NULL otherwise. https://gitlab.gnome.org/GNOME/gtk/issues/1084
* | display: Avoid unsetting the DESKTOP_STARTUP_ID variable too lateMario Sanchez Prada2018-06-111-13/+5
|/ | | | | | | | | | | | | | | Similar to what has been done recently for DESKTOP_AUTOSTART_ID [1], we need to get rid of this call to g_unsetenv() in the displays' backends for X11 and Wayland, so that it's guarantee to happen any thread is created, while still being accessible when needed. Let's stash the value of this environment variable when loading the GDK library, and provide a private method so that it can be retrieved from the displays' backend when implementing gdk_display_make_default(). [1] https://gitlab.gnome.org/GNOME/gtk/commit/22269902 Closes: https://gitlab.gnome.org/GNOME/gtk/issues/979
* wayland: Add support for xdg-shell stableJonas Ådahl2018-05-011-15/+54
| | | | | | | | | | This commit adds support the stable version of the xdg-shell protocol. Support for the last version of the unstable series is left intact, but will not receive new features. The stable version is prioritized above the older version. https://bugzilla.gnome.org/show_bug.cgi?id=791939
* Misc documentation fixesMatthias Clasen2018-04-281-3/+1
| | | | Close some gaps in gdk docs.
* gdk: Add Cairo context implementations for all backendsBenjamin Otte2018-04-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And make the GdkCairoContext as abstract. The idea of this and thje following commits is to get rid of all Cairo code in gdksurface.c (and $backend/gdksurface-$backend.c) by moving that code into the Cairo context files. In particular, the GdkSurfaceClass.begin_frame/end_frame() functions (which are currently exclusively used by the Cairo code should end up being moved to GdkDrawContextClass.begin/end_frame(). This has multiple benefits: 1. It unifies code between the different drawing contexts. GL lives in GLContext, Vulkan in VulkanContext and Cairo in CairoContext. In turn, this makes it way easier to reason about what's going on in surface-specific code. Currently pretty much all backends do things wrong when they want to sync to drawing or to the frame clock. 2. It makes the API of GdkSurface smaller. No drawing code (apart from creating the contexts) needs to remain. 3. It confines Cairo to the Drawcontext, thereby making it way more obvious when backends are still using it in situations where it may now conflict with OpenGL (like when doing the dnd failed animation or in the APIs that I'm removing in this branch). 4. We have 2 very different types of Cairo contexts: The X/win32 model, where we have a natively supported Cairo backend but do double buffering ourselves and use similar surfaces and the Wayland/Broadway model where we use image surfaces without any Cairo backend support and have to submit the buffers manually. By not sharing code between those 2 versions, we can make the actual code way smaller. We also get around the need to create 1x1 image surfaces in the Wayland backend where we pretend there's a native Cairo surface.
* GdkSurface: Rename lots of stuff from window->surfaceAlexander Larsson2018-03-201-2/+2
| | | | | Mostly these are internal things, but the major public change is that event.window is now event.surface.
* GdkSurface: Rename various functions and variablesAlexander Larsson2018-03-201-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an automatic rename of various things related to the window->surface rename. Public symbols changed by this is: GDK_MODE_WINDOW gdk_device_get_window_at_position gdk_device_get_window_at_position_double gdk_device_get_last_event_window gdk_display_get_monitor_at_window gdk_drag_context_get_source_window gdk_drag_context_get_dest_window gdk_drag_context_get_drag_window gdk_draw_context_get_window gdk_drawing_context_get_window gdk_gl_context_get_window gdk_synthesize_window_state gdk_surface_get_window_type gdk_x11_display_set_window_scale gsk_renderer_new_for_window gsk_renderer_get_window gtk_text_view_buffer_to_window_coords gtk_tree_view_convert_widget_to_bin_window_coords gtk_tree_view_convert_tree_to_bin_window_coords The commands that generated this are: git sed -f g "GDK window" "GDK surface" git sed -f g window_impl surface_impl (cd gdk; git sed -f g impl_window impl_surface) git sed -f g WINDOW_IMPL SURFACE_IMPL git sed -f g GDK_MODE_WINDOW GDK_MODE_SURFACE git sed -f g gdk_draw_context_get_window gdk_draw_context_get_surface git sed -f g gdk_drawing_context_get_window gdk_drawing_context_get_surface git sed -f g gdk_gl_context_get_window gdk_gl_context_get_surface git sed -f g gsk_renderer_get_window gsk_renderer_get_surface git sed -f g gsk_renderer_new_for_window gsk_renderer_new_for_surface (cd gdk; git sed -f g window_type surface_type) git sed -f g gdk_surface_get_window_type gdk_surface_get_surface_type git sed -f g window_at_position surface_at_position git sed -f g event_window event_surface git sed -f g window_coord surface_coord git sed -f g window_state surface_state git sed -f g window_cursor surface_cursor git sed -f g window_scale surface_scale git sed -f g window_events surface_events git sed -f g monitor_at_window monitor_at_surface git sed -f g window_under_pointer surface_under_pointer (cd gdk; git sed -f g for_window for_surface) git sed -f g window_anchor surface_anchor git sed -f g WINDOW_IS_TOPLEVEL SURFACE_IS_TOPLEVEL git sed -f g native_window native_surface git sed -f g source_window source_surface git sed -f g dest_window dest_surface git sed -f g drag_window drag_surface git sed -f g input_window input_surface git checkout NEWS* po-properties po docs/reference/gtk/migrating-3to4.xml
* GdkWindow -> GdkSurface initial type renameAlexander Larsson2018-03-201-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This renames the GdkWindow class and related classes (impl, backend subclasses) to surface. Additionally it renames related types: GdkWindowAttr, GdkWindowPaint, GdkWindowWindowClass, GdkWindowType, GdkWindowTypeHint, GdkWindowHints, GdkWindowState, GdkWindowEdge This is an automatic conversion using the below commands: git sed -f g GdkWindowWindowClass GdkSurfaceSurfaceClass git sed -f g GdkWindow GdkSurface git sed -f g "gdk_window\([ _\(\),;]\|$\)" "gdk_surface\1" # Avoid hitting gdk_windowing git sed -f g "GDK_WINDOW\([ _\(]\|$\)" "GDK_SURFACE\1" # Avoid hitting GDK_WINDOWING git sed "GDK_\([A-Z]*\)IS_WINDOW\([_ (]\|$\)" "GDK_\1IS_SURFACE\2" git sed GDK_TYPE_WINDOW GDK_TYPE_SURFACE git sed -f g GdkPointerWindowInfo GdkPointerSurfaceInfo git sed -f g "BROADWAY_WINDOW" "BROADWAY_SURFACE" git sed -f g "broadway_window" "broadway_surface" git sed -f g "BroadwayWindow" "BroadwaySurface" git sed -f g "WAYLAND_WINDOW" "WAYLAND_SURFACE" git sed -f g "wayland_window" "wayland_surface" git sed -f g "WaylandWindow" "WaylandSurface" git sed -f g "X11_WINDOW" "X11_SURFACE" git sed -f g "x11_window" "x11_surface" git sed -f g "X11Window" "X11Surface" git sed -f g "WIN32_WINDOW" "WIN32_SURFACE" git sed -f g "win32_window" "win32_surface" git sed -f g "Win32Window" "Win32Surface" git sed -f g "QUARTZ_WINDOW" "QUARTZ_SURFACE" git sed -f g "quartz_window" "quartz_surface" git sed -f g "QuartzWindow" "QuartzSurface" git checkout NEWS* po-properties
* gdk/wayland: Add GdkDisplay call to query available globalsCarlos Garnacho2018-02-131-6/+36
| | | | | | | | | | | The internal known_globals hashtable is used to carry accounting for interfaces that depend on others (as ordering is not guaranteed), extend its usage so it also keeps track of unimplemented interfaces (here at least). The API call will then use this to allow querying the globals offered by the compositor, it will be useful to determine whether we can use text-input protocols or should fallback to other IMs.
* The big versioning cleanupMatthias Clasen2018-02-061-6/+0
| | | | | | | Remove all the old 2.x and 3.x version annotations. GTK+ 4 is a new start, and from the perspective of a GTK+ 4 developer all these APIs have been around since the beginning.
* gdk: Drop some unused cursor apisMatthias Clasen2018-01-161-4/+0
| | | | | | | The query function for cursor sizes and capabilities are not very interesting. At least, they are not used in GTK+, and all backends but X11 just hardcode made-up values anyway. So, lets drop them.
* Make gdk logging per-displayMatthias Clasen2018-01-141-1/+1
| | | | | | | As far as possible, use per-display debug flags. This will minimize the debug spew that we get from the inspector if it is running on a separate display.
* wayland: Set display on keymapsMatthias Clasen2018-01-121-1/+1
| | | | | This was forgotten so far: The display of keymaps was NULL.
* display: Remove leftover old clipboard APIsBenjamin Otte2017-12-141-17/+0
|
* gdk: Remove ability to request selection notificationsBenjamin Otte2017-12-141-17/+0
| | | | Without selections, that's kinda pointless.
* gdk: Remove gdk_selection_convert()Benjamin Otte2017-12-141-3/+0
| | | | It's not used anymore.
* gdk: Remove ability to own a selectionBenjamin Otte2017-12-131-2/+0
| | | | | With this, the GDK_EVENT_SELECTION_REQUEST and GDK_EVENT_SELECTION_CLEAR and the associated GtkWidget signals are gone, too.
* gdk: Remove gdk_selection_add_targets()Benjamin Otte2017-12-131-2/+0
| | | | | | | It's not needed anymore, now that we can look at the content provider's formats. Alose remove all the API in GTK that was used to set it.
* wayland: Don't provide gsetting if dconf is not availableMatthias Clasen2017-11-261-0/+3
| | | | | | | This makes gtk+ fall back to reading ~/.config/gtk-3.0/settings.ini on systems with Wayland, but without dconf (do those exist?). https://bugzilla.gnome.org/show_bug.cgi?id=790201
* wayland: Drop GdkWaylandDeviceManagerMatthias Clasen2017-11-251-7/+2
| | | | This object had no functionality left.
* wayland: Stop deriving from GdkDeviceManagerMatthias Clasen2017-11-251-1/+0
| | | | We can just derive from GObject.
* Drop the GdkDeviceManager::display propertyMatthias Clasen2017-11-251-1/+4
| | | | | Move this to the backends, and stop deriving from GdkDeviceManager.
* wayland: Stop using display->device_managerMatthias Clasen2017-11-251-6/+3
| | | | We can keep the device manager in the backend.
* wayland: Intern settings keysMatthias Clasen2017-11-171-0/+7
|
* Add private api for setting cursor themeMatthias Clasen2017-11-171-0/+1
| | | | | | This is implemented in multiple gdk backends, and we can avoid and ugly ifdef cascade in gtk by adding a vfunc for this.
* Drop the error trap vfuncsMatthias Clasen2017-11-171-14/+0
| | | | No longer used.
* selection: Remove #ifdef WAYLANDBenjamin Otte2017-11-151-0/+2
| | | | | | | Instead, turn the functions into backend API: gdk_broadway_display_add_selection_targets() gdk_broadway_display_clear_selection_targets() Remove the old per-backend functions, too.
* wayland: Drop the root windowMatthias Clasen2017-11-061-14/+26
| | | | We can just keep a list of toplevels in the display.
* Drop gdk_display_get_root_windowMatthias Clasen2017-11-051-7/+0
| | | | This is no longer used.
* wayland: Stop using gdk_display_get_root_windowMatthias Clasen2017-11-051-1/+1
| | | | We can just use the display field directly.
* gdk: Cursors are created genericallyBenjamin Otte2017-11-041-2/+0
| | | | There are no longer subclasses for cursors now.
* wayland: Redo cursor handlingBenjamin Otte2017-11-041-2/+0
| | | | This is in line with the X11 changes last patch.
* cursor: Turn new_from_surface() into new_from_texture()Benjamin Otte2017-11-041-1/+1
| | | | | Also turn all the arguments into read-only properties on the GdkCursor object.
* t Remove gdk_cursor_new_for_displayMatthias Clasen2017-11-011-1/+0
| | | | | | The preferred api to create cursors is by name, and the GdkCursorType enumeration can directly trace its ancestry to the horrible X cursor font. So lets stop using it.
* wayland: No more screenMatthias Clasen2017-11-011-20/+772
| | | | | This gets rid of the GdkWaylandScreen object and all remnants of GdkScreen in the wayland backend.
* Drop gdk_display_get_default_screenMatthias Clasen2017-11-011-9/+0
| | | | | Also remove the backend implementations. This api is no longer used.
* Add gdk_display_get_toplevel_windowsMatthias Clasen2017-10-311-0/+7
| | | | | | This is replacing the corresponding GdkScreen api, which is going away. To implement this, we need to add a get_root_window vfunc to GdkDisplay.
* wayland: Stop using gdk_screen_get_settingMatthias Clasen2017-10-301-2/+2
| | | | Use gdk_display_get_setting instead.
* wayland: Implement the GdkDisplay get_setting vfuncMatthias Clasen2017-10-301-0/+9
| | | | Just call the GdkScreen vfunc.
* Wayland: Implement KDE's SSD protocolDrew DeVault2017-10-261-0/+39
| | | | | | | | | | If the compositor prefers server-side decorations and the client doesn't customize the title bar, we disable client-side decorations and let the compositor know. Otherwise, we continue to use client-side decorations. Signed-off-by: Drew DeVault <sir@cmpwn.com> https://bugzilla.gnome.org/show_bug.cgi?id=781909
* GdkDisplay: Add a private _emit_openedTimm Bäder2017-10-101-1/+1
| | | | | So we don't have to use the slower g_signal_emit_by_name in startup paths.
* gdk/wayland: Don't make gtk_shell1 v2 mandatoryCarlos Garnacho2017-09-191-1/+1
| | | | | | It may result in a protocol error on older mutters, as GTK+ will invariably request a higher version than what's available. Make GTK+ also accept v1 if it's all the compositor has got.
* wayland: Bump GTK_SHELL1 version to 2Georges Basile Stavracas Neto2017-09-181-1/+3
| | | | | | Otherwise, we can't negotiate the latest version with the compositor, making the compositor use v1 of the protocol and pretty much ignoring all the edge constraints work.
* wayland: add shortcut inhibitor supportOlivier Fourdan2017-08-021-0/+6
| | | | | | | | | | | | 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