Skip to content
Commits on Source (124)
Overview of Changes in GTK+ 3.24.24
===================================
* GtkColorChooser:
- Update the default color palette
* GtkFontChooser:
- Fix family-only mode to return regular style
* GtkTreeView:
- Don't set focus-on-click for header buttons
* Accessibility:
- Implement scrollSubstringTo
- Add a11y support to GtkPlug/GtkSocket
* Printing:
- Allow the lpr backend to print pdf and ps files
* Theme:
- Update gesture graphics
- Update HighContrast css
* Wayland:
- Support the primary-selection-unstable-v1 protocol
* X11:
- Fix a crash with parent-relative backgrounds
* Broadway:
- Set modifier state of scroll events
* Build:
- Fix pc file generation on NixOS
* OS X:
- Restore command-key bindings
* Windows:
- Fix meson build with epoxy subproject
* Translation updates:
Basque
Brazilian Portuguese
British English
Catalan
Croatian
Czech
French
Galician
German
Greek
Hebrew
Hungarian
Indonesian
Italian
Kazakh
Latvian
Lithuanian
Persian
Polish
Portuguese
Slovak
Slovenian
Spanish
Swedish
Turkish
Ukrainian
Overview of Changes in GTK+ 3.24.23
===================================
 
......
......@@ -10,8 +10,8 @@
m4_define([gtk_major_version], [3])
m4_define([gtk_minor_version], [24])
m4_define([gtk_micro_version], [23])
m4_define([gtk_interface_age], [19])
m4_define([gtk_micro_version], [24])
m4_define([gtk_interface_age], [20])
m4_define([gtk_binary_age],
[m4_eval(100 * gtk_minor_version + gtk_micro_version)])
m4_define([gtk_version],
......@@ -56,12 +56,12 @@ GLIB_VERSION_CFLAGS="-DGLIB_MIN_REQUIRED_VERSION=glib_min_required_version -DGLI
m4_define([pango_required_version], [1.41.0])
m4_define([fribidi_required_version], [0.19.7])
m4_define([atk_required_version], [2.15.1])
m4_define([atk_required_version], [2.32.0])
m4_define([cairo_required_version], [1.14.0])
m4_define([gdk_pixbuf_required_version], [2.30.0])
m4_define([introspection_required_version], [1.39.0])
m4_define([wayland_required_version], [1.14.91])
m4_define([wayland_protocols_required_version], [1.14])
m4_define([wayland_protocols_required_version], [1.17])
m4_define([epoxy_required_version], [1.4])
m4_define([cloudproviders_required_version], [0.2.5])
m4_define([sysprof_required_version], [3.33.2])
......
......@@ -224,6 +224,7 @@ _gdk_broadway_events_got_input (BroadwayInputMsg *message)
event->scroll.y = message->pointer.win_y;
event->scroll.x_root = message->pointer.root_x;
event->scroll.y_root = message->pointer.root_y;
event->scroll.state = message->pointer.state;
event->scroll.direction = message->scroll.dir == 0 ? GDK_SCROLL_UP : GDK_SCROLL_DOWN;
gdk_event_set_device (event, device_manager->core_pointer);
gdk_event_set_seat (event, gdk_device_get_seat (device_manager->core_pointer));
......
......@@ -226,7 +226,7 @@ gdk_cursor_get_cursor_type (GdkCursor *cursor)
*
* Creates a new cursor from the set of builtin cursors.
*
* Returns: a new #GdkCursor
* Returns: (nullable) (transfer full): a new #GdkCursor, or %NULL on failure
*
* Since: 2.2
**/
......
......@@ -185,9 +185,9 @@
-(void)doCommandBySelector: (SEL)aSelector
{
GDK_NOTE (EVENTS, g_message ("doCommandBySelector"));
if ([self respondsToSelector: aSelector])
[self performSelector: aSelector];
GDK_NOTE (EVENTS, g_message ("doCommandBySelector %s", aSelector));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)insertText: (id)aString replacementRange: (NSRange)replacementRange
......@@ -246,335 +246,6 @@
_gdk_quartz_synthesize_null_key_event(gdk_window);
}
}
-(void)deleteBackward: (id)sender
{
GDK_NOTE (EVENTS, g_message ("deleteBackward"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)deleteForward: (id)sender
{
GDK_NOTE (EVENTS, g_message ("deleteForward"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)deleteToBeginningOfLine: (id)sender
{
GDK_NOTE (EVENTS, g_message ("deleteToBeginningOfLine"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)deleteToEndOfLine: (id)sender
{
GDK_NOTE (EVENTS, g_message ("deleteToEndOfLine"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)deleteWordBackward: (id)sender
{
GDK_NOTE (EVENTS, g_message ("deleteWordBackward"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)deleteWordForward: (id)sender
{
GDK_NOTE (EVENTS, g_message ("deleteWordForward"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)insertBacktab: (id)sender
{
GDK_NOTE (EVENTS, g_message ("insertBacktab"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)insertNewline: (id)sender
{
GDK_NOTE (EVENTS, g_message ("insertNewline"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY, GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)insertTab: (id)sender
{
GDK_NOTE (EVENTS, g_message ("insertTab"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveBackward: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveBackward"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveBackwardAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveBackwardAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveDown: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveDown"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveDownAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveDownAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveForward: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveForward"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveForwardAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveForwardAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveLeft: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveLeft"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveLeftAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveLeftAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveRight: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveRight"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveRightAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveRightAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveToBeginningOfDocument: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveToBeginningOfDocument"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveToBeginningOfDocumentAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveToBeginningOfDocumentAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveToBeginningOfLine: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveToBeginningOfLine"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveToBeginningOfLineAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveToBeginningOfLineAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveToEndOfDocument: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveToEndOfDocument"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveToEndOfDocumentAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveToEndOfDocumentAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveToEndOfLine: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveToEndOfLine"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveToEndOfLineAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveToEndOfLineAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveUp: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveUp"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveUpAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveUpAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveWordBackward: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveWordBackward"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveWordBackwardAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveWordBackwardAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveWordForward: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveWordForward"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveWordForwardAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveWordForwardAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveWordLeft: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveWordLeft"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveWordLeftAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveWordLeftAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveWordRight: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveWordRight"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)moveWordRightAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("moveWordRightAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)pageDown: (id)sender
{
GDK_NOTE (EVENTS, g_message ("pageDown"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)pageDownAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("pageDownAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)pageUp: (id)sender
{
GDK_NOTE (EVENTS, g_message ("pageUp"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)pageUpAndModifySelection: (id)sender
{
GDK_NOTE (EVENTS, g_message ("pageUpAndModifySelection"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)scrollPageDown: (id)sender
{
GDK_NOTE (EVENTS, g_message ("scrollPageDown"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)scrollPageUp: (id)sender
{
GDK_NOTE (EVENTS, g_message ("scrollPageUp"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)selectAll: (id)sender
{
GDK_NOTE (EVENTS, g_message ("selectAll"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)selectLine: (id)sender
{
GDK_NOTE (EVENTS, g_message ("selectLine"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)selectWord: (id)sender
{
GDK_NOTE (EVENTS, g_message ("selectWord"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
-(void)noop: (id)sender
{
GDK_NOTE (EVENTS, g_message ("noop"));
g_object_set_data (G_OBJECT (gdk_window), GIC_FILTER_KEY,
GUINT_TO_POINTER (GIC_FILTER_PASSTHRU));
}
/* --------------------------------------------------------------- */
-(void)dealloc
......
......@@ -40,7 +40,9 @@ BUILT_SOURCES = \
server-decoration-client-protocol.h \
server-decoration-protocol.c \
gtk-shell-client-protocol.h \
gtk-shell-protocol.c
gtk-shell-protocol.c \
primary-selection-unstable-v1-client-protocol.h \
primary-selection-unstable-v1-protocol.c
nodist_libgdk_wayland_la_SOURCES = \
$(BUILT_SOURCES)
......
......@@ -237,7 +237,8 @@ struct _GdkWaylandSeat
uint32_t keyboard_time;
uint32_t keyboard_key_serial;
struct gtk_primary_selection_device *primary_data_device;
struct gtk_primary_selection_device *gtk_primary_data_device;
struct zwp_primary_selection_device_v1 *zwp_primary_data_device_v1;
struct wl_data_device *data_device;
GdkDragContext *drop_context;
......@@ -1308,23 +1309,43 @@ static const struct wl_data_device_listener data_device_listener = {
};
static void
primary_selection_data_offer (void *data,
struct gtk_primary_selection_device *gtk_primary_selection_device,
struct gtk_primary_selection_offer *gtk_primary_offer)
primary_selection_data_offer (void *data,
gpointer primary_selection_device,
gpointer primary_offer)
{
GdkWaylandSeat *seat = data;
GDK_NOTE (EVENTS,
g_message ("primary selection offer, device %p, data offer %p",
gtk_primary_selection_device, gtk_primary_offer));
primary_selection_device, primary_offer));
gdk_wayland_selection_ensure_primary_offer (seat->display, gtk_primary_offer);
gdk_wayland_selection_ensure_primary_offer (seat->display, primary_offer);
}
static void
primary_selection_selection (void *data,
struct gtk_primary_selection_device *gtk_primary_selection_device,
struct gtk_primary_selection_offer *gtk_primary_offer)
gtk_primary_selection_data_offer (void *data,
struct gtk_primary_selection_device *primary_selection_device,
struct gtk_primary_selection_offer *primary_offer)
{
primary_selection_data_offer (data,
(gpointer) primary_selection_device,
(gpointer) primary_offer);
}
static void
zwp_primary_selection_v1_data_offer (void *data,
struct zwp_primary_selection_device_v1 *primary_selection_device,
struct zwp_primary_selection_offer_v1 *primary_offer)
{
primary_selection_data_offer (data,
(gpointer) primary_selection_device,
(gpointer) primary_offer);
}
static void
primary_selection_selection (void *data,
gpointer primary_selection_device,
gpointer primary_offer)
{
GdkWaylandSeat *seat = data;
GdkAtom selection;
......@@ -1334,16 +1355,41 @@ primary_selection_selection (void *data,
GDK_NOTE (EVENTS,
g_message ("primary selection selection, device %p, data offer %p",
gtk_primary_selection_device, gtk_primary_offer));
primary_selection_device, primary_offer));
selection = gdk_atom_intern_static_string ("PRIMARY");
gdk_wayland_selection_set_offer (seat->display, selection, gtk_primary_offer);
gdk_wayland_selection_set_offer (seat->display, selection, primary_offer);
emit_selection_owner_change (seat->keyboard_focus, selection);
}
static const struct gtk_primary_selection_device_listener primary_selection_device_listener = {
primary_selection_data_offer,
primary_selection_selection,
static void
gtk_primary_selection_selection (void *data,
struct gtk_primary_selection_device *primary_selection_device,
struct gtk_primary_selection_offer *primary_offer)
{
primary_selection_selection (data,
(gpointer) primary_selection_device,
(gpointer) primary_offer);
}
static void
zwp_primary_selection_v1_selection (void *data,
struct zwp_primary_selection_device_v1 *primary_selection_device,
struct zwp_primary_selection_offer_v1 *primary_offer)
{
primary_selection_selection (data,
(gpointer) primary_selection_device,
(gpointer) primary_offer);
}
static const struct gtk_primary_selection_device_listener gtk_primary_device_listener = {
gtk_primary_selection_data_offer,
gtk_primary_selection_selection,
};
static const struct zwp_primary_selection_device_v1_listener zwp_primary_device_v1_listener = {
zwp_primary_selection_v1_data_offer,
zwp_primary_selection_v1_selection,
};
static GdkDevice * get_scroll_device (GdkWaylandSeat *seat,
......@@ -5078,13 +5124,23 @@ _gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager,
wl_seat_add_listener (seat->wl_seat, &seat_listener, seat);
wl_seat_set_user_data (seat->wl_seat, seat);
if (display_wayland->primary_selection_manager)
if (display_wayland->zwp_primary_selection_manager_v1)
{
seat->primary_data_device =
gtk_primary_selection_device_manager_get_device (display_wayland->primary_selection_manager,
seat->zwp_primary_data_device_v1 =
zwp_primary_selection_device_manager_v1_get_device (display_wayland->zwp_primary_selection_manager_v1,
seat->wl_seat);
zwp_primary_selection_device_v1_add_listener (seat->zwp_primary_data_device_v1,
&zwp_primary_device_v1_listener,
seat);
}
else if (display_wayland->gtk_primary_selection_manager)
{
seat->gtk_primary_data_device =
gtk_primary_selection_device_manager_get_device (display_wayland->gtk_primary_selection_manager,
seat->wl_seat);
gtk_primary_selection_device_add_listener (seat->primary_data_device,
&primary_selection_device_listener, seat);
gtk_primary_selection_device_add_listener (seat->gtk_primary_data_device,
&gtk_primary_device_listener,
seat);
}
seat->data_device =
......@@ -5355,8 +5411,8 @@ gdk_wayland_seat_set_selection (GdkSeat *seat,
}
void
gdk_wayland_seat_set_primary (GdkSeat *seat,
struct gtk_primary_selection_source *source)
gdk_wayland_seat_set_primary (GdkSeat *seat,
gpointer source)
{
GdkWaylandSeat *wayland_seat = GDK_WAYLAND_SEAT (seat);
GdkWaylandDisplay *display_wayland;
......@@ -5366,8 +5422,16 @@ gdk_wayland_seat_set_primary (GdkSeat *seat,
{
display_wayland = GDK_WAYLAND_DISPLAY (gdk_seat_get_display (seat));
serial = _gdk_wayland_display_get_serial (display_wayland);
gtk_primary_selection_device_set_selection (wayland_seat->primary_data_device,
source, serial);
if (wayland_seat->zwp_primary_data_device_v1)
{
zwp_primary_selection_device_v1_set_selection (wayland_seat->zwp_primary_data_device_v1,
source, serial);
}
else if (wayland_seat->gtk_primary_data_device)
{
gtk_primary_selection_device_set_selection (wayland_seat->gtk_primary_data_device,
source, serial);
}
}
}
......
......@@ -476,10 +476,16 @@ gdk_registry_handle_global (void *data,
}
else if (strcmp (interface, "gtk_primary_selection_device_manager") == 0)
{
display_wayland->primary_selection_manager =
display_wayland->gtk_primary_selection_manager =
wl_registry_bind(display_wayland->wl_registry, id,
&gtk_primary_selection_device_manager_interface, 1);
}
else if (strcmp (interface, "zwp_primary_selection_device_manager_v1") == 0)
{
display_wayland->zwp_primary_selection_manager_v1 =
wl_registry_bind(display_wayland->wl_registry, id,
&zwp_primary_selection_device_manager_v1_interface, 1);
}
else if (strcmp (interface, "zwp_tablet_manager_v2") == 0)
{
display_wayland->tablet_manager =
......
......@@ -35,6 +35,7 @@
#include <gdk/wayland/keyboard-shortcuts-inhibit-unstable-v1-client-protocol.h>
#include <gdk/wayland/server-decoration-client-protocol.h>
#include <gdk/wayland/xdg-output-unstable-v1-client-protocol.h>
#include <gdk/wayland/primary-selection-unstable-v1-client-protocol.h>
#include <glib.h>
#include <gdk/gdkkeys.h>
......@@ -88,7 +89,8 @@ struct _GdkWaylandDisplay
struct wl_data_device_manager *data_device_manager;
struct wl_subcompositor *subcompositor;
struct zwp_pointer_gestures_v1 *pointer_gestures;
struct gtk_primary_selection_device_manager *primary_selection_manager;
struct gtk_primary_selection_device_manager *gtk_primary_selection_manager;
struct zwp_primary_selection_device_manager_v1 *zwp_primary_selection_manager_v1;
struct zwp_tablet_manager_v2 *tablet_manager;
struct zxdg_exporter_v1 *xdg_exporter;
struct zxdg_importer_v1 *xdg_importer;
......
......@@ -191,8 +191,8 @@ struct wl_data_device * gdk_wayland_device_get_data_device (GdkDevice *gdk_devic
void gdk_wayland_seat_set_selection (GdkSeat *seat,
struct wl_data_source *source);
void gdk_wayland_seat_set_primary (GdkSeat *seat,
struct gtk_primary_selection_source *source);
void gdk_wayland_seat_set_primary (GdkSeat *seat,
gpointer source);
GdkDragContext * gdk_wayland_device_get_drop_context (GdkDevice *gdk_device);
......@@ -249,8 +249,8 @@ void gdk_wayland_selection_free (GdkWaylandSelection *selection);
void gdk_wayland_selection_ensure_offer (GdkDisplay *display,
struct wl_data_offer *wl_offer);
void gdk_wayland_selection_ensure_primary_offer (GdkDisplay *display,
struct gtk_primary_selection_offer *wp_offer);
void gdk_wayland_selection_ensure_primary_offer (GdkDisplay *display,
gpointer wp_offer);
void gdk_wayland_selection_set_offer (GdkDisplay *display,
GdkAtom selection,
......
......@@ -104,7 +104,7 @@ struct _GdkWaylandSelection
GArray *source_targets;
GdkAtom requested_target;
struct gtk_primary_selection_source *primary_source;
gpointer primary_source;
GdkWindow *primary_owner;
struct wl_data_source *clipboard_source;
......@@ -434,6 +434,18 @@ gdk_wayland_selection_new (void)
return selection;
}
static void
primary_selection_source_destroy (gpointer primary_source)
{
GdkDisplay *display = gdk_display_get_default ();
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
if (display_wayland->zwp_primary_selection_manager_v1)
zwp_primary_selection_source_v1_destroy (primary_source);
else if (display_wayland->gtk_primary_selection_manager)
gtk_primary_selection_source_destroy (primary_source);
}
void
gdk_wayland_selection_free (GdkWaylandSelection *selection)
{
......@@ -448,7 +460,7 @@ gdk_wayland_selection_free (GdkWaylandSelection *selection)
g_ptr_array_unref (selection->stored_selections);
if (selection->primary_source)
gtk_primary_selection_source_destroy (selection->primary_source);
primary_selection_source_destroy (selection->primary_source);
if (selection->clipboard_source)
wl_data_source_destroy (selection->clipboard_source);
if (selection->dnd_source)
......@@ -546,27 +558,47 @@ static const struct wl_data_offer_listener data_offer_listener = {
};
static void
primary_offer_offer (void *data,
struct gtk_primary_selection_offer *gtk_offer,
const char *type)
primary_offer_offer (void *data,
gpointer offer,
const char *type)
{
GdkWaylandSelection *selection = data;
DataOfferData *info;
GdkAtom atom = gdk_atom_intern (type, FALSE);
info = g_hash_table_lookup (selection->offers, gtk_offer);
info = g_hash_table_lookup (selection->offers, offer);
if (!info || g_list_find (info->targets, atom))
return;
GDK_NOTE (EVENTS,
g_message ("primary offer offer, offer %p, type = %s", gtk_offer, type));
g_message ("primary offer offer, offer %p, type = %s", offer, type));
info->targets = g_list_prepend (info->targets, atom);
}
static const struct gtk_primary_selection_offer_listener primary_offer_listener = {
primary_offer_offer,
static void
gtk_primary_offer_offer (void *data,
struct gtk_primary_selection_offer *offer,
const char *type)
{
primary_offer_offer (data, (gpointer) offer, type);
}
static void
zwp_primary_offer_v1_offer (void *data,
struct zwp_primary_selection_offer_v1 *offer,
const char *type)
{
primary_offer_offer (data, (gpointer) offer, type);
}
static const struct gtk_primary_selection_offer_listener gtk_primary_offer_listener = {
gtk_primary_offer_offer,
};
static const struct zwp_primary_selection_offer_v1_listener zwp_primary_offer_listener_v1 = {
zwp_primary_offer_v1_offer,
};
SelectionData *
......@@ -604,9 +636,10 @@ gdk_wayland_selection_ensure_offer (GdkDisplay *display,
}
void
gdk_wayland_selection_ensure_primary_offer (GdkDisplay *display,
struct gtk_primary_selection_offer *gtk_offer)
gdk_wayland_selection_ensure_primary_offer (GdkDisplay *display,
gpointer gtk_offer)
{
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
GdkWaylandSelection *selection = gdk_wayland_display_get_selection (display);
DataOfferData *info;
......@@ -614,12 +647,24 @@ gdk_wayland_selection_ensure_primary_offer (GdkDisplay *
if (!info)
{
info = data_offer_data_new (gtk_offer,
(GDestroyNotify) gtk_primary_selection_offer_destroy);
g_hash_table_insert (selection->offers, gtk_offer, info);
gtk_primary_selection_offer_add_listener (gtk_offer,
&primary_offer_listener,
selection);
if (display_wayland->zwp_primary_selection_manager_v1)
{
info = data_offer_data_new (gtk_offer,
(GDestroyNotify) zwp_primary_selection_offer_v1_destroy);
g_hash_table_insert (selection->offers, gtk_offer, info);
zwp_primary_selection_offer_v1_add_listener (gtk_offer,
&zwp_primary_offer_listener_v1,
selection);
}
else if (display_wayland->gtk_primary_selection_manager)
{
info = data_offer_data_new (gtk_offer,
(GDestroyNotify) gtk_primary_selection_offer_destroy);
g_hash_table_insert (selection->offers, gtk_offer, info);
gtk_primary_selection_offer_add_listener (gtk_offer,
&gtk_primary_offer_listener,
selection);
}
}
}
......@@ -1138,10 +1183,10 @@ static const struct wl_data_source_listener data_source_listener = {
};
static void
primary_source_send (void *data,
struct gtk_primary_selection_source *source,
const char *mime_type,
int32_t fd)
primary_source_send (void *data,
gpointer source,
const char *mime_type,
int32_t fd)
{
GdkWaylandSelection *wayland_selection = data;
......@@ -1163,8 +1208,26 @@ primary_source_send (void *data,
}
static void
primary_source_cancelled (void *data,
struct gtk_primary_selection_source *source)
gtk_primary_source_send (void *data,
struct gtk_primary_selection_source *source,
const char *mime_type,
int32_t fd)
{
primary_source_send (data, (gpointer) source, mime_type, fd);
}
static void
zwp_primary_source_v1_send (void *data,
struct zwp_primary_selection_source_v1 *source,
const char *mime_type,
int32_t fd)
{
primary_source_send (data, (gpointer) source, mime_type, fd);
}
static void
primary_source_cancelled (void *data,
gpointer source)
{
GdkDisplay *display;
GdkAtom atom;
......@@ -1180,9 +1243,28 @@ primary_source_cancelled (void *data,
gdk_wayland_selection_unset_data_source (display, atom);
}
static const struct gtk_primary_selection_source_listener primary_source_listener = {
primary_source_send,
primary_source_cancelled,
static void
gtk_primary_source_cancelled (void *data,
struct gtk_primary_selection_source *source)
{
primary_source_cancelled (data, source);
}
static void
zwp_primary_source_v1_cancelled (void *data,
struct zwp_primary_selection_source_v1 *source)
{
primary_source_cancelled (data, source);
}
static const struct gtk_primary_selection_source_listener gtk_primary_source_listener = {
gtk_primary_source_send,
gtk_primary_source_cancelled,
};
static const struct zwp_primary_selection_source_v1_listener zwp_primary_source_v1_listener = {
zwp_primary_source_v1_send,
zwp_primary_source_v1_cancelled,
};
struct wl_data_source *
......@@ -1204,11 +1286,11 @@ gdk_wayland_selection_get_data_source (GdkWindow *owner,
{
if (wayland_selection->primary_source &&
(!owner || owner == wayland_selection->primary_owner))
return (gpointer) wayland_selection->primary_source;
return wayland_selection->primary_source;
if (wayland_selection->primary_source)
{
gtk_primary_selection_source_destroy (wayland_selection->primary_source);
primary_selection_source_destroy (wayland_selection->primary_source);
wayland_selection->primary_source = NULL;
}
}
......@@ -1234,11 +1316,18 @@ gdk_wayland_selection_get_data_source (GdkWindow *owner,
if (selection == atoms[ATOM_PRIMARY])
{
if (display_wayland->primary_selection_manager)
if (display_wayland->zwp_primary_selection_manager_v1)
{
source = zwp_primary_selection_device_manager_v1_create_source (display_wayland->zwp_primary_selection_manager_v1);
zwp_primary_selection_source_v1_add_listener (source,
&zwp_primary_source_v1_listener,
wayland_selection);
}
else if (display_wayland->gtk_primary_selection_manager)
{
source = gtk_primary_selection_device_manager_create_source (display_wayland->primary_selection_manager);
source = gtk_primary_selection_device_manager_create_source (display_wayland->gtk_primary_selection_manager);
gtk_primary_selection_source_add_listener (source,
&primary_source_listener,
&gtk_primary_source_listener,
wayland_selection);
}
}
......@@ -1278,7 +1367,7 @@ gdk_wayland_selection_unset_data_source (GdkDisplay *display,
{
if (wayland_selection->primary_source)
{
gtk_primary_selection_source_destroy (wayland_selection->primary_source);
primary_selection_source_destroy (wayland_selection->primary_source);
wayland_selection->primary_source = NULL;
}
}
......@@ -1449,6 +1538,7 @@ _gdk_wayland_display_convert_selection (GdkDisplay *display,
GdkAtom target,
guint32 time)
{
GdkWaylandDisplay *display_wayland = GDK_WAYLAND_DISPLAY (display);
GdkWaylandSelection *wayland_selection = gdk_wayland_display_get_selection (display);
const SelectionData *selection_data;
SelectionBuffer *buffer_data;
......@@ -1514,9 +1604,16 @@ _gdk_wayland_display_convert_selection (GdkDisplay *display,
g_unix_open_pipe (pipe_fd, FD_CLOEXEC, NULL);
if (selection == atoms[ATOM_PRIMARY])
gtk_primary_selection_offer_receive (offer, mimetype, pipe_fd[1]);
{
if (display_wayland->zwp_primary_selection_manager_v1)
zwp_primary_selection_offer_v1_receive (offer, mimetype, pipe_fd[1]);
else if (display_wayland->gtk_primary_selection_manager)
gtk_primary_selection_offer_receive (offer, mimetype, pipe_fd[1]);
}
else
wl_data_offer_receive (offer, mimetype, pipe_fd[1]);
{
wl_data_offer_receive (offer, mimetype, pipe_fd[1]);
}
stream = g_unix_input_stream_new (pipe_fd[0], TRUE);
close (pipe_fd[1]);
......
......@@ -1349,6 +1349,9 @@ gdk_wayland_window_sync_margin (GdkWindow *window)
return;
gdk_wayland_window_get_window_geometry (window, &geometry);
g_return_if_fail (geometry.width > 0 && geometry.height > 0);
gdk_window_set_geometry_hints (window,
&impl->geometry_hints,
impl->geometry_mask);
......@@ -3495,7 +3498,19 @@ gdk_window_wayland_move_resize (GdkWindow *window,
if (!should_use_fixed_size (window->state) ||
(width == impl->fixed_size_width &&
height == impl->fixed_size_height))
gdk_wayland_window_maybe_configure (window, width, height, impl->scale);
{
gdk_wayland_window_maybe_configure (window,
width,
height,
impl->scale);
}
else if (!should_inhibit_resize (window))
{
gdk_wayland_window_configure (window,
window->width,
window->height,
impl->scale);
}
}
}
......
......@@ -56,6 +56,7 @@ proto_sources = [
['keyboard-shortcuts-inhibit', 'unstable', 'v1', ],
['server-decoration', 'private' ],
['xdg-output', 'unstable', 'v1', ],
['primary-selection', 'unstable', 'v1', ],
]
gdk_wayland_gen_headers = []
......
......@@ -1863,202 +1863,6 @@ generate_button_event (GdkEventType type,
_gdk_win32_append_event (event);
}
/*
* Used by the stacking functions to see if a window
* should be always on top.
* Restacking is only done if both windows are either ontop
* or not ontop.
*/
static gboolean
should_window_be_always_on_top (GdkWindow *window)
{
DWORD exstyle;
if ((GDK_WINDOW_TYPE (window) == GDK_WINDOW_TEMP) ||
(window->state & GDK_WINDOW_STATE_ABOVE))
return TRUE;
exstyle = GetWindowLong (GDK_WINDOW_HWND (window), GWL_EXSTYLE);
if (exstyle & WS_EX_TOPMOST)
return TRUE;
return FALSE;
}
static void
ensure_stacking_on_unminimize (MSG *msg)
{
HWND rover;
HWND lowest_transient = NULL;
GdkWindow *msg_window;
gboolean window_ontop = FALSE;
msg_window = gdk_win32_handle_table_lookup (msg->hwnd);
if (msg_window)
window_ontop = should_window_be_always_on_top (msg_window);
for (rover = GetNextWindow (msg->hwnd, GW_HWNDNEXT);
rover;
rover = GetNextWindow (rover, GW_HWNDNEXT))
{
GdkWindow *rover_gdkw = gdk_win32_handle_table_lookup (rover);
GdkWindowImplWin32 *rover_impl;
gboolean rover_ontop;
/* Checking window group not implemented yet */
if (rover_gdkw == NULL)
continue;
rover_ontop = should_window_be_always_on_top (rover_gdkw);
rover_impl = GDK_WINDOW_IMPL_WIN32 (rover_gdkw->impl);
if (GDK_WINDOW_IS_MAPPED (rover_gdkw) &&
(rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY ||
rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG ||
rover_impl->transient_owner != NULL) &&
((window_ontop && rover_ontop) || (!window_ontop && !rover_ontop)))
{
lowest_transient = rover;
}
}
if (lowest_transient != NULL)
{
GDK_NOTE (EVENTS,
g_print (" restacking %p above %p",
msg->hwnd, lowest_transient));
SetWindowPos (msg->hwnd, lowest_transient, 0, 0, 0, 0,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOOWNERZORDER);
}
}
static gboolean
ensure_stacking_on_window_pos_changing (MSG *msg,
GdkWindow *window)
{
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
WINDOWPOS *windowpos = (WINDOWPOS *) msg->lParam;
HWND rover;
gboolean restacking;
gboolean window_ontop;
if (GetActiveWindow () != msg->hwnd ||
impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY ||
impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG ||
impl->transient_owner != NULL)
return FALSE;
/* Make sure the window stays behind any transient-type windows
* of the same window group.
*
* If the window is not active and being activated, we let
* Windows bring it to the top and rely on the WM_ACTIVATEAPP
* handling to bring any utility windows on top of it.
*/
window_ontop = should_window_be_always_on_top (window);
for (rover = windowpos->hwndInsertAfter, restacking = FALSE;
rover;
rover = GetNextWindow (rover, GW_HWNDNEXT))
{
GdkWindow *rover_gdkw = gdk_win32_handle_table_lookup (rover);
GdkWindowImplWin32 *rover_impl;
gboolean rover_ontop;
/* Checking window group not implemented yet */
if (rover_gdkw == NULL)
continue;
rover_ontop = should_window_be_always_on_top (rover_gdkw);
rover_impl = GDK_WINDOW_IMPL_WIN32 (rover_gdkw->impl);
if (GDK_WINDOW_IS_MAPPED (rover_gdkw) &&
(rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY ||
rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG ||
rover_impl->transient_owner != NULL) &&
((window_ontop && rover_ontop) || (!window_ontop && !rover_ontop)))
{
restacking = TRUE;
windowpos->hwndInsertAfter = rover;
}
}
if (restacking)
{
GDK_NOTE (EVENTS,
g_print (" letting Windows restack %p above %p",
msg->hwnd, windowpos->hwndInsertAfter));
return TRUE;
}
return FALSE;
}
static void
ensure_stacking_on_activate_app (MSG *msg,
GdkWindow *window)
{
GdkWindowImplWin32 *impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
HWND rover;
gboolean window_ontop;
if (impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY ||
impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG ||
impl->transient_owner != NULL)
{
SetWindowPos (msg->hwnd, HWND_TOP, 0, 0, 0, 0,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOOWNERZORDER);
return;
}
if (!IsWindowVisible (msg->hwnd) ||
msg->hwnd != GetActiveWindow ())
return;
/* This window is not a transient-type window and it is the
* activated window. Make sure this window is as visible as
* possible, just below the lowest transient-type window of this
* app.
*/
window_ontop = should_window_be_always_on_top (window);
for (rover = GetNextWindow (msg->hwnd, GW_HWNDPREV);
rover;
rover = GetNextWindow (rover, GW_HWNDPREV))
{
GdkWindow *rover_gdkw = gdk_win32_handle_table_lookup (rover);
GdkWindowImplWin32 *rover_impl;
gboolean rover_ontop;
/* Checking window group not implemented yet */
if (rover_gdkw == NULL)
continue;
rover_ontop = should_window_be_always_on_top (rover_gdkw);
rover_impl = GDK_WINDOW_IMPL_WIN32 (rover_gdkw->impl);
if (GDK_WINDOW_IS_MAPPED (rover_gdkw) &&
(rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_UTILITY ||
rover_impl->type_hint == GDK_WINDOW_TYPE_HINT_DIALOG ||
rover_impl->transient_owner != NULL) &&
((window_ontop && rover_ontop) || (!window_ontop && !rover_ontop)))
{
GDK_NOTE (EVENTS,
g_print (" restacking %p above %p",
msg->hwnd, rover));
SetWindowPos (msg->hwnd, rover, 0, 0, 0, 0,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOOWNERZORDER);
break;
}
}
}
static gboolean
handle_wm_sysmenu (GdkWindow *window, MSG *msg, gint *ret_valp)
{
......@@ -3367,8 +3171,6 @@ gdk_event_translate (MSG *msg,
if (GDK_WINDOW_IS_MAPPED (window))
{
return_val = ensure_stacking_on_window_pos_changing (msg, window);
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
if (impl->maximizing)
......@@ -3458,13 +3260,6 @@ gdk_event_translate (MSG *msg,
if ((old_state & GDK_WINDOW_STATE_ICONIFIED) !=
(new_state & GDK_WINDOW_STATE_ICONIFIED))
do_show_window (window, (new_state & GDK_WINDOW_STATE_ICONIFIED));
/* When un-minimizing, make sure we're stacked under any
transient-type windows. */
if (!(old_state & GDK_WINDOW_STATE_ICONIFIED) &&
(new_state & GDK_WINDOW_STATE_ICONIFIED))
ensure_stacking_on_unminimize (msg);
}
/* Show, New size or position => configure event */
......@@ -3946,8 +3741,6 @@ gdk_event_translate (MSG *msg,
GDK_NOTE (EVENTS, g_print (" %s thread: %" G_GINT64_FORMAT,
msg->wParam ? "YES" : "NO",
(gint64) msg->lParam));
if (msg->wParam && GDK_WINDOW_IS_MAPPED (window))
ensure_stacking_on_activate_app (msg, window);
break;
case WM_NCHITTEST:
/* TODO: pass all messages to DwmDefWindowProc() first! */
......
......@@ -1474,7 +1474,7 @@ show_window_internal (GdkWindow *window,
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window),
(window->state & GDK_WINDOW_STATE_ABOVE)?HWND_TOPMOST:HWND_NOTOPMOST,
0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOOWNERZORDER));
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE));
}
}
......@@ -1834,7 +1834,7 @@ gdk_win32_window_raise (GdkWindow *window)
else
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), HWND_TOP,
0, 0, 0, 0,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOOWNERZORDER));
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE));
}
}
......@@ -1851,7 +1851,7 @@ gdk_win32_window_lower (GdkWindow *window)
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), HWND_BOTTOM,
0, 0, 0, 0,
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE | SWP_NOOWNERZORDER));
SWP_NOACTIVATE | SWP_NOMOVE | SWP_NOSIZE));
}
}
......@@ -2910,7 +2910,7 @@ _gdk_win32_window_update_style_bits (GdkWindow *window)
rect.right += after.right - before.right;
rect.bottom += after.bottom - before.bottom;
flags = SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOREPOSITION | SWP_NOOWNERZORDER;
flags = SWP_FRAMECHANGED | SWP_NOACTIVATE | SWP_NOREPOSITION;
if (will_be_topmost && !was_topmost)
{
......@@ -5372,7 +5372,7 @@ gdk_win32_window_fullscreen (GdkWindow *window)
y - workaround_padding,
width + (workaround_padding * 2),
height + (workaround_padding * 2),
SWP_NOCOPYBITS | SWP_SHOWWINDOW | SWP_NOOWNERZORDER));
SWP_NOCOPYBITS | SWP_SHOWWINDOW));
}
}
......@@ -5396,7 +5396,7 @@ gdk_win32_window_unfullscreen (GdkWindow *window)
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window), HWND_NOTOPMOST,
fi->r.left, fi->r.top,
fi->r.right - fi->r.left, fi->r.bottom - fi->r.top,
SWP_NOCOPYBITS | SWP_SHOWWINDOW | SWP_NOOWNERZORDER));
SWP_NOCOPYBITS | SWP_SHOWWINDOW));
g_object_set_data (G_OBJECT (window), "fullscreen-info", NULL);
g_free (fi);
......@@ -5422,7 +5422,7 @@ gdk_win32_window_set_keep_above (GdkWindow *window,
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window),
setting ? HWND_TOPMOST : HWND_NOTOPMOST,
0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOOWNERZORDER));
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE));
}
gdk_synthesize_window_state (window,
......@@ -5448,7 +5448,7 @@ gdk_win32_window_set_keep_below (GdkWindow *window,
API_CALL (SetWindowPos, (GDK_WINDOW_HWND (window),
setting ? HWND_BOTTOM : HWND_NOTOPMOST,
0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOOWNERZORDER));
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE));
}
gdk_synthesize_window_state (window,
......
......@@ -3025,12 +3025,29 @@ G_GNUC_END_IGNORE_DEPRECATIONS
if (pattern == parent_relative_pattern)
{
GdkWindow *parent;
Window xroot, xparent, *xchildren;
guint nxchildren, xparent_depth;
XWindowAttributes xattrs;
if (!XQueryTree (GDK_WINDOW_XDISPLAY (window), GDK_WINDOW_XID (window),
&xroot, &xparent, &xchildren, &nxchildren))
{
XSetWindowBackgroundPixmap (GDK_WINDOW_XDISPLAY (window),
GDK_WINDOW_XID (window), None);
return;
}
if (xchildren)
XFree (xchildren);
if (xparent) {
XGetWindowAttributes (GDK_WINDOW_XDISPLAY (window), xparent, &xattrs);
xparent_depth = xattrs.depth;
}
/* X throws BadMatch if the parent has a different depth when
* using ParentRelative */
parent = gdk_window_get_parent (window);
if (parent != NULL && window->depth == parent->depth &&
if (xparent && window->depth == xparent_depth &&
cairo_pattern_status (pattern) == CAIRO_STATUS_SUCCESS)
{
XSetWindowBackgroundPixmap (GDK_WINDOW_XDISPLAY (window),
......
......@@ -31,6 +31,7 @@ a11y_h_sources = \
a11y/gtknotebookaccessible.h \
a11y/gtknotebookpageaccessible.h \
a11y/gtkpanedaccessible.h \
a11y/gtkplugaccessible.h \
a11y/gtkpopoveraccessible.h \
a11y/gtkprogressbaraccessible.h \
a11y/gtkradiobuttonaccessible.h \
......@@ -40,6 +41,7 @@ a11y_h_sources = \
a11y/gtkscaleaccessible.h \
a11y/gtkscalebuttonaccessible.h \
a11y/gtkscrolledwindowaccessible.h \
a11y/gtksocketaccessible.h \
a11y/gtkspinbuttonaccessible.h \
a11y/gtkspinneraccessible.h \
a11y/gtkstatusbaraccessible.h \
......@@ -106,6 +108,7 @@ a11y_c_sources = \
a11y/gtknotebookaccessible.c \
a11y/gtknotebookpageaccessible.c \
a11y/gtkpanedaccessible.c \
a11y/gtkplugaccessible.c \
a11y/gtkpopoveraccessible.c \
a11y/gtkprogressbaraccessible.c \
a11y/gtkradiobuttonaccessible.c \
......@@ -115,6 +118,7 @@ a11y_c_sources = \
a11y/gtkscaleaccessible.c \
a11y/gtkscalebuttonaccessible.c \
a11y/gtkscrolledwindowaccessible.c \
a11y/gtksocketaccessible.c \
a11y/gtkspinbuttonaccessible.c \
a11y/gtkspinneraccessible.c \
a11y/gtkstatusbaraccessible.c \
......
......@@ -311,18 +311,10 @@ gtk_notebook_page_accessible_get_extents (AtkComponent *component,
label = get_label_from_notebook_page (GTK_NOTEBOOK_PAGE_ACCESSIBLE (component));
if (!label)
{
AtkObject *child;
*width = 0;
*height = 0;
child = atk_object_ref_accessible_child (ATK_OBJECT (component), 0);
if (!child)
return;
atk_component_get_extents (ATK_COMPONENT (child), x, y, NULL, NULL,
coord_type);
g_object_unref (child);
*x = -1;
*y = -1;
*width = -1;
*height = -1;
}
else
{
......
/* GTK+ - accessibility implementations
* Copyright 2019 Samuel Thibault <sthibault@hypra.fr>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <gtk/gtk.h>
#include "gtkplugaccessible.h"
#ifdef GTK_HAVE_ATK_PLUG_SET_CHILD
/* We can not make GtkPlugAccessible inherit both from GtkContainerAccessible
* and GtkPlug, so we make it the atk child of an AtkPlug */
struct _GtkPlugAccessiblePrivate
{
AtkObject *accessible_plug;
};
G_DEFINE_TYPE_WITH_CODE (GtkPlugAccessible, gtk_plug_accessible, GTK_TYPE_WINDOW_ACCESSIBLE,
G_ADD_PRIVATE (GtkPlugAccessible))
static void
gtk_plug_accessible_finalize (GObject *object)
{
GtkPlugAccessible *plug = GTK_PLUG_ACCESSIBLE (object);
GtkPlugAccessiblePrivate *priv = plug->priv;
g_clear_object (&priv->accessible_plug);
G_OBJECT_CLASS (gtk_plug_accessible_parent_class)->finalize (object);
}
static void
gtk_plug_accessible_initialize (AtkObject *plug, gpointer data)
{
AtkObject *atk_plug;
ATK_OBJECT_CLASS (gtk_plug_accessible_parent_class)->initialize (plug, data);
atk_plug = atk_plug_new ();
atk_plug_set_child (ATK_PLUG (atk_plug), plug);
GTK_PLUG_ACCESSIBLE (plug)->priv->accessible_plug = atk_plug;
}
static void
gtk_plug_accessible_class_init (GtkPlugAccessibleClass *klass) {
AtkObjectClass *atk_class = ATK_OBJECT_CLASS (klass);
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
atk_class->initialize = gtk_plug_accessible_initialize;
gobject_class->finalize = gtk_plug_accessible_finalize;
}
static void
gtk_plug_accessible_init (GtkPlugAccessible *plug)
{
plug->priv = gtk_plug_accessible_get_instance_private (plug);
}
gchar *
gtk_plug_accessible_get_id (GtkPlugAccessible *plug)
{
return atk_plug_get_id (ATK_PLUG (plug->priv->accessible_plug));
}
#endif /* GTK_HAVE_ATK_PLUG_SET_CHILD */
/* GTK+ - accessibility implementations
* Copyright 2019 Samuel Thibault <sthibault@hypra.fr>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __GTK_PLUG_ACCESSIBLE_H__
#define __GTK_PLUG_ACCESSIBLE_H__
#if !defined (__GTK_A11Y_H_INSIDE__) && !defined (GTK_COMPILATION)
#error "Only <gtk/gtk-a11y.h> can be included directly."
#endif
#include <gtk/a11y/gtkwindowaccessible.h>
#if ATK_CHECK_VERSION(2,35,1)
#define GTK_HAVE_ATK_PLUG_SET_CHILD
G_BEGIN_DECLS
#define GTK_TYPE_PLUG_ACCESSIBLE (gtk_plug_accessible_get_type ())
#define GTK_PLUG_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PLUG_ACCESSIBLE, GtkPlugAccessible))
#define GTK_PLUG_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_PLUG_ACCESSIBLE, GtkPlugAccessibleClass))
#define GTK_IS_PLUG_ACCESSIBLE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PLUG_ACCESSIBLE))
#define GTK_IS_PLUG_ACCESSIBLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_PLUG_ACCESSIBLE))
#define GTK_PLUG_ACCESSIBLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_PLUG_ACCESSIBLE, GtkPlugAccessibleClass))
typedef struct _GtkPlugAccessible GtkPlugAccessible;
typedef struct _GtkPlugAccessibleClass GtkPlugAccessibleClass;
typedef struct _GtkPlugAccessiblePrivate GtkPlugAccessiblePrivate;
struct _GtkPlugAccessible
{
GtkWindowAccessible parent;
GtkPlugAccessiblePrivate *priv;
};
struct _GtkPlugAccessibleClass
{
GtkWindowAccessibleClass parent_class;
};
GDK_AVAILABLE_IN_ALL
GType gtk_plug_accessible_get_type (void);
GDK_AVAILABLE_IN_ALL
gchar *gtk_plug_accessible_get_id (GtkPlugAccessible *plug);
G_END_DECLS
#endif /* ATK_CHECK_VERSION(2,35,1) */
#endif /* __GTK_PLUG_ACCESSIBLE_H__ */