Compare commits
56 Commits
3.24.2
..
ft.headers
| Author | SHA1 | Date | |
|---|---|---|---|
| 728339e1ce | |||
| 70b7b89411 | |||
| a8e07254d3 | |||
| da54692ab7 | |||
| 69508b014d | |||
| 3a1c5f7232 | |||
| 4eee51b0e5 | |||
| 06ffbb2a22 | |||
| f6bc2415ab | |||
| 5662f2e34f | |||
| dea38f0222 | |||
| 63e0eb5de5 | |||
| c876c74eb7 | |||
| cc329d36e0 | |||
| d3b6d16d85 | |||
| b69aae4ab3 | |||
| ea518ec2f5 | |||
| a9d7d41b59 | |||
| b283b0b910 | |||
| e9f527b328 | |||
| 32ad0ffa0f | |||
| 55894c48a5 | |||
| d179b0667d | |||
| ee5873be19 | |||
| 33faf46516 | |||
| 1c1a86d0fc | |||
| 1a9377bab9 | |||
| e105fefc49 | |||
| 7b33369bfb | |||
| c6dd92294d | |||
| f173d1bc5c | |||
| 3986326bbf | |||
| be60ddbec9 | |||
| 33a966952a | |||
| f7eb7efeb5 | |||
| eb821cb89b | |||
| 013b9cbc1f | |||
| aeec73f53f | |||
| baa283b73b | |||
| 112645edf2 | |||
| 3e6fd50d96 | |||
| f879741e89 | |||
| 8b0fd8e148 | |||
| 43aeb52b73 | |||
| e3a1593a09 | |||
| 2a3c0ab841 | |||
| 6a47e9a8b9 | |||
| 2905fc861a | |||
| 31d896c5cf | |||
| f535443da6 | |||
| e416aebe5f | |||
| bb3653ad7d | |||
| 4bdf968702 | |||
| 28ac1a2cba | |||
| 3d6510329f | |||
| c477201afc |
@@ -144,7 +144,7 @@ create_capital_store (void)
|
||||
{ NULL, "Jackson" },
|
||||
{ NULL, "Jefferson City" },
|
||||
{ NULL, "Juneau" },
|
||||
{ "K - O" },
|
||||
{ "K - O", NULL },
|
||||
{ NULL, "Lansing" },
|
||||
{ NULL, "Lincoln" },
|
||||
{ NULL, "Little Rock" },
|
||||
@@ -154,7 +154,7 @@ create_capital_store (void)
|
||||
{ NULL, "Nashville" },
|
||||
{ NULL, "Oklahoma City" },
|
||||
{ NULL, "Olympia" },
|
||||
{ NULL, "P - S" },
|
||||
{ "P - S", NULL },
|
||||
{ NULL, "Phoenix" },
|
||||
{ NULL, "Pierre" },
|
||||
{ NULL, "Providence" },
|
||||
|
||||
@@ -170,10 +170,10 @@ take_window_shot (Window child,
|
||||
y_orig = 0;
|
||||
}
|
||||
|
||||
if (x_orig + width > gdk_screen_get_width (gdk_screen_get_dfeault ()))
|
||||
if (x_orig + width > gdk_screen_width ())
|
||||
width = gdk_screen_width () - x_orig;
|
||||
|
||||
if (y_orig + height > gdk_screen_get_height (gdk_screen_get_default ()))
|
||||
if (y_orig + height > gdk_screen_height ())
|
||||
height = gdk_screen_height () - y_orig;
|
||||
|
||||
tmp = gdk_pixbuf_get_from_window (window,
|
||||
|
||||
+1
-1
@@ -62,7 +62,7 @@ G_BEGIN_DECLS
|
||||
#define GDK_PRIORITY_EVENTS (G_PRIORITY_DEFAULT)
|
||||
|
||||
/**
|
||||
* GDK_PRIORITY_REDRAW:
|
||||
* GDK_PRIORITY_REDRAW: (value 120)
|
||||
*
|
||||
* This is the priority that the idle handler processing window updates
|
||||
* is given in the
|
||||
|
||||
+8
-8
@@ -149,7 +149,7 @@ parse_rgb_value (const gchar *str,
|
||||
* - A RGBA color in the form “rgba(r,g,b,a)”
|
||||
*
|
||||
* Where “r”, “g”, “b” and “a” are respectively the red, green, blue and
|
||||
* alpha color values. In the last two cases, r g and b are either integers
|
||||
* alpha color values. In the last two cases, “r”, “g”, and “b” are either integers
|
||||
* in the range 0 to 255 or percentage values in the range 0% to 100%, and
|
||||
* a is a floating point value in the range 0 to 1.
|
||||
*
|
||||
@@ -333,18 +333,18 @@ gdk_rgba_equal (gconstpointer p1,
|
||||
* @rgba: a #GdkRGBA
|
||||
*
|
||||
* Returns a textual specification of @rgba in the form
|
||||
* `rgb (r, g, b)` or
|
||||
* `rgba (r, g, b, a)`,
|
||||
* `rgb(r,g,b)` or
|
||||
* `rgba(r g,b,a)`,
|
||||
* where “r”, “g”, “b” and “a” represent the red, green,
|
||||
* blue and alpha values respectively. r, g, and b are
|
||||
* represented as integers in the range 0 to 255, and a
|
||||
* is represented as floating point value in the range 0 to 1.
|
||||
* blue and alpha values respectively. “r”, “g”, and “b” are
|
||||
* represented as integers in the range 0 to 255, and “a”
|
||||
* is represented as a floating point value in the range 0 to 1.
|
||||
*
|
||||
* These string forms are string forms those supported by
|
||||
* These string forms are string forms that are supported by
|
||||
* the CSS3 colors module, and can be parsed by gdk_rgba_parse().
|
||||
*
|
||||
* Note that this string representation may lose some
|
||||
* precision, since r, g and b are represented as 8-bit
|
||||
* precision, since “r”, “g” and “b” are represented as 8-bit
|
||||
* integers. If this is a concern, you should use a
|
||||
* different representation.
|
||||
*
|
||||
|
||||
+3
-2
@@ -449,12 +449,13 @@ gdk_seat_tool_removed (GdkSeat *seat,
|
||||
|
||||
GdkDeviceTool *
|
||||
gdk_seat_get_tool (GdkSeat *seat,
|
||||
guint64 serial)
|
||||
guint64 serial,
|
||||
guint64 hw_id)
|
||||
{
|
||||
GdkSeatClass *seat_class;
|
||||
|
||||
g_return_val_if_fail (GDK_IS_SEAT (seat), NULL);
|
||||
|
||||
seat_class = GDK_SEAT_GET_CLASS (seat);
|
||||
return seat_class->get_tool (seat, serial);
|
||||
return seat_class->get_tool (seat, serial, hw_id);
|
||||
}
|
||||
|
||||
@@ -275,7 +275,8 @@ gdk_seat_default_get_slaves (GdkSeat *seat,
|
||||
|
||||
static GdkDeviceTool *
|
||||
gdk_seat_default_get_tool (GdkSeat *seat,
|
||||
guint64 serial)
|
||||
guint64 serial,
|
||||
guint64 hw_id)
|
||||
{
|
||||
GdkSeatDefaultPrivate *priv;
|
||||
GdkDeviceTool *tool;
|
||||
@@ -290,7 +291,7 @@ gdk_seat_default_get_tool (GdkSeat *seat,
|
||||
{
|
||||
tool = g_ptr_array_index (priv->tools, i);
|
||||
|
||||
if (tool->serial == serial)
|
||||
if (tool->serial == serial && tool->hw_id == hw_id)
|
||||
return tool;
|
||||
}
|
||||
|
||||
@@ -436,8 +437,7 @@ gdk_seat_default_remove_tool (GdkSeatDefault *seat,
|
||||
|
||||
priv = gdk_seat_default_get_instance_private (seat);
|
||||
|
||||
if (tool != gdk_seat_get_tool (GDK_SEAT (seat),
|
||||
gdk_device_tool_get_serial (tool)))
|
||||
if (tool != gdk_seat_get_tool (GDK_SEAT (seat), tool->serial, tool->hw_id))
|
||||
return;
|
||||
|
||||
g_signal_emit_by_name (seat, "tool-removed", tool);
|
||||
|
||||
@@ -57,7 +57,8 @@ struct _GdkSeatClass
|
||||
GdkSeatCapabilities capabilities);
|
||||
|
||||
GdkDeviceTool * (* get_tool) (GdkSeat *seat,
|
||||
guint64 serial);
|
||||
guint64 serial,
|
||||
guint64 tool_id);
|
||||
};
|
||||
|
||||
void gdk_seat_device_added (GdkSeat *seat,
|
||||
@@ -72,6 +73,7 @@ void gdk_seat_tool_removed (GdkSeat *seat,
|
||||
|
||||
GdkDeviceTool *
|
||||
gdk_seat_get_tool (GdkSeat *seat,
|
||||
guint64 serial);
|
||||
guint64 serial,
|
||||
guint64 hw_id);
|
||||
|
||||
#endif /* __GDK_SEAT_PRIVATE_H__ */
|
||||
|
||||
@@ -379,22 +379,46 @@
|
||||
|
||||
initialPositionKnown = NO;
|
||||
}
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 101200
|
||||
|
||||
- (NSPoint)convertPointToScreen:(NSPoint)point
|
||||
{
|
||||
NSRect inrect = NSMakeRect (point.x, point.y, 0.0, 0.0);
|
||||
NSRect outrect = [self convertRectToScreen: inrect];
|
||||
return (NSPoint)((CGRect)outrect).origin;
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
|
||||
if (gdk_quartz_osx_version () >= GDK_OSX_MOJAVE)
|
||||
{
|
||||
return [super convertPointToScreen: point];
|
||||
}
|
||||
#endif
|
||||
if (gdk_quartz_osx_version () >= GDK_OSX_LION)
|
||||
{
|
||||
NSRect inrect = NSMakeRect (point.x, point.y, 0.0, 0.0);
|
||||
NSRect outrect = [self convertRectToScreen: inrect];
|
||||
return (NSPoint)((CGRect)outrect).origin;
|
||||
}
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
|
||||
return [self convertBaseToScreen:point];
|
||||
#endif
|
||||
}
|
||||
|
||||
- (NSPoint)convertPointFromScreen:(NSPoint)point
|
||||
{
|
||||
NSRect inrect = NSMakeRect (point.x, point.y, 0.0, 0.0);
|
||||
NSRect outrect = [self convertRectFromScreen: inrect];
|
||||
return (NSPoint)((CGRect)outrect).origin;
|
||||
}
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 101400
|
||||
if (gdk_quartz_osx_version () >= GDK_OSX_MOJAVE)
|
||||
{
|
||||
return [super convertPointFromScreen: point];
|
||||
}
|
||||
#endif
|
||||
if (gdk_quartz_osx_version () >= GDK_OSX_LION)
|
||||
{
|
||||
NSRect inrect = NSMakeRect (point.x, point.y, 0.0, 0.0);
|
||||
NSRect outrect = [self convertRectFromScreen: inrect];
|
||||
return (NSPoint)((CGRect)outrect).origin;
|
||||
}
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
|
||||
return [self convertScreenToBase:point];
|
||||
#endif
|
||||
}
|
||||
|
||||
- (BOOL)trackManualMove
|
||||
{
|
||||
@@ -407,11 +431,8 @@
|
||||
|
||||
if (!inManualMove)
|
||||
return NO;
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
|
||||
currentLocation = [self convertBaseToScreen:[self mouseLocationOutsideOfEventStream]];
|
||||
#else
|
||||
|
||||
currentLocation = [self convertPointToScreen:[self mouseLocationOutsideOfEventStream]];
|
||||
#endif
|
||||
newOrigin.x = currentLocation.x - initialMoveLocation.x;
|
||||
newOrigin.y = currentLocation.y - initialMoveLocation.y;
|
||||
|
||||
@@ -442,11 +463,7 @@
|
||||
|
||||
inManualMove = YES;
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
|
||||
initialMoveLocation = [self convertBaseToScreen:[self mouseLocationOutsideOfEventStream]];
|
||||
#else
|
||||
initialMoveLocation = [self convertPointToScreen:[self mouseLocationOutsideOfEventStream]];
|
||||
#endif
|
||||
initialMoveLocation.x -= frame.origin.x;
|
||||
initialMoveLocation.y -= frame.origin.y;
|
||||
}
|
||||
@@ -462,12 +479,7 @@
|
||||
return NO;
|
||||
|
||||
inTrackManualResize = YES;
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
|
||||
mouse_location = [self convertBaseToScreen:[self mouseLocationOutsideOfEventStream]];
|
||||
#else
|
||||
mouse_location = [self convertPointToScreen:[self mouseLocationOutsideOfEventStream]];
|
||||
#endif
|
||||
mdx = initialResizeLocation.x - mouse_location.x;
|
||||
mdy = initialResizeLocation.y - mouse_location.y;
|
||||
|
||||
@@ -552,12 +564,7 @@
|
||||
resizeEdge = edge;
|
||||
|
||||
initialResizeFrame = [self frame];
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
|
||||
initialResizeLocation = [self convertBaseToScreen:[self mouseLocationOutsideOfEventStream]];
|
||||
#else
|
||||
initialResizeLocation = [self convertPointToScreen:[self mouseLocationOutsideOfEventStream]];
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -690,13 +697,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
|
||||
- (NSDragOperation)draggingUpdated:(id <NSDraggingInfo>)sender
|
||||
{
|
||||
NSPoint point = [sender draggingLocation];
|
||||
NSPoint screen_point;
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
|
||||
screen_point = [self convertBaseToScreen:point];
|
||||
#else
|
||||
screen_point = [self convertPointToScreen:point];
|
||||
#endif
|
||||
NSPoint screen_point = [self convertPointToScreen:point];
|
||||
GdkEvent *event;
|
||||
int gx, gy;
|
||||
|
||||
@@ -724,13 +725,7 @@ update_context_from_dragging_info (id <NSDraggingInfo> sender)
|
||||
- (BOOL)performDragOperation:(id <NSDraggingInfo>)sender
|
||||
{
|
||||
NSPoint point = [sender draggingLocation];
|
||||
NSPoint screen_point;
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
|
||||
screen_point = [self convertBaseToScreen:point];
|
||||
#else
|
||||
screen_point = [self convertPointToScreen:point];
|
||||
#endif
|
||||
NSPoint screen_point = [self convertPointToScreen:point];
|
||||
GdkEvent *event;
|
||||
int gy, gx;
|
||||
|
||||
|
||||
@@ -53,10 +53,8 @@
|
||||
#ifdef AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER
|
||||
-(void)setStyleMask:(NSUInteger)styleMask;
|
||||
#endif
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 101200
|
||||
- (NSPoint)convertPointToScreen:(NSPoint)point;
|
||||
- (NSPoint)convertPointFromScreen:(NSPoint)point;
|
||||
#endif
|
||||
@end
|
||||
|
||||
|
||||
|
||||
@@ -252,10 +252,17 @@ configure_monitor (GdkMonitor *monitor)
|
||||
monitor->width_mm = width;
|
||||
monitor->height_mm = height;
|
||||
monitor->geometry = disp_geometry;
|
||||
monitor->scale_factor = 1;
|
||||
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1080
|
||||
if (mode && gdk_quartz_osx_version () >= GDK_OSX_MOUNTAIN_LION)
|
||||
{
|
||||
monitor->scale_factor = CGDisplayModeGetPixelWidth (mode) / CGDisplayModeGetWidth (mode);
|
||||
CGDisplayModeRelease (mode);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
monitor->scale_factor = 1;
|
||||
monitor->refresh_rate = refresh_rate;
|
||||
monitor->subpixel_layout = GDK_SUBPIXEL_LAYOUT_UNKNOWN;
|
||||
CGDisplayModeRelease (mode);
|
||||
}
|
||||
|
||||
static void
|
||||
|
||||
@@ -379,12 +379,7 @@ get_window_point_from_screen_point (GdkWindow *window,
|
||||
GdkQuartzNSWindow *nswindow;
|
||||
|
||||
nswindow = (GdkQuartzNSWindow*)(((GdkWindowImplQuartz *)window->impl)->toplevel);
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 1070
|
||||
point = [nswindow convertScreenToBase:screen_point];
|
||||
#else
|
||||
point = [nswindow convertPointFromScreen:screen_point];
|
||||
#endif
|
||||
*x = point.x;
|
||||
*y = window->height - point.y;
|
||||
}
|
||||
@@ -460,12 +455,7 @@ get_toplevel_from_ns_event (NSEvent *nsevent,
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gdk_quartz_osx_version () >= GDK_OSX_LION)
|
||||
*screen_point = [(GdkQuartzNSWindow*)[nsevent window] convertPointToScreen:point];
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED < 10700
|
||||
else
|
||||
*screen_point = [[nsevent window] convertBaseToScreen:point];
|
||||
#endif
|
||||
*screen_point = [(GdkQuartzNSWindow*)[nsevent window] convertPointToScreen:point];
|
||||
*x = point.x;
|
||||
*y = toplevel->height - point.y;
|
||||
}
|
||||
@@ -1551,8 +1541,10 @@ gdk_event_translate (GdkEvent *event,
|
||||
grab = _gdk_display_get_last_device_grab (_gdk_display,
|
||||
gdk_seat_get_pointer (seat));
|
||||
}
|
||||
return_val = TRUE;
|
||||
}
|
||||
|
||||
return_val = TRUE;
|
||||
|
||||
switch (event_type)
|
||||
{
|
||||
case GDK_QUARTZ_LEFT_MOUSE_DOWN:
|
||||
|
||||
@@ -491,6 +491,7 @@ update_xft_settings (GdkScreen *screen)
|
||||
|
||||
static TranslationEntry translations[] = {
|
||||
{ FALSE, "org.gnome.desktop.interface", "gtk-theme", "gtk-theme-name" , G_TYPE_STRING, { .s = "Adwaita" } },
|
||||
{ FALSE, "org.gnome.desktop.interface", "gtk-key-theme", "gtk-key-theme-name" , G_TYPE_STRING, { .s = "Default" } },
|
||||
{ FALSE, "org.gnome.desktop.interface", "icon-theme", "gtk-icon-theme-name", G_TYPE_STRING, { .s = "gnome" } },
|
||||
{ FALSE, "org.gnome.desktop.interface", "cursor-theme", "gtk-cursor-theme-name", G_TYPE_STRING, { .s = "Adwaita" } },
|
||||
{ FALSE, "org.gnome.desktop.interface", "cursor-size", "gtk-cursor-theme-size", G_TYPE_INT, { .i = 32 } },
|
||||
|
||||
@@ -2256,7 +2256,7 @@ gdk_settings_notify (GdkWindow *window,
|
||||
new_event->setting.window = window;
|
||||
new_event->setting.send_event = FALSE;
|
||||
new_event->setting.action = action;
|
||||
new_event->setting.name = (char*) name;
|
||||
new_event->setting.name = g_strdup (name);
|
||||
|
||||
_gdk_win32_append_event (new_event);
|
||||
}
|
||||
|
||||
@@ -38,6 +38,23 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
static const char *wacom_type_atoms[] = {
|
||||
"STYLUS",
|
||||
"CURSOR",
|
||||
"ERASER",
|
||||
"PAD",
|
||||
"TOUCH"
|
||||
};
|
||||
#define N_WACOM_TYPE_ATOMS G_N_ELEMENTS (wacom_type_atoms)
|
||||
|
||||
enum {
|
||||
WACOM_TYPE_STYLUS,
|
||||
WACOM_TYPE_CURSOR,
|
||||
WACOM_TYPE_ERASER,
|
||||
WACOM_TYPE_PAD,
|
||||
WACOM_TYPE_TOUCH,
|
||||
};
|
||||
|
||||
struct _GdkX11DeviceManagerXI2
|
||||
{
|
||||
GdkX11DeviceManagerCore parent_object;
|
||||
@@ -1018,6 +1035,66 @@ device_get_tool_serial_and_id (GdkDevice *device,
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static GdkDeviceToolType
|
||||
device_get_tool_type (GdkDevice *device)
|
||||
{
|
||||
GdkDisplay *display;
|
||||
gulong nitems, bytes_after;
|
||||
guint32 *data;
|
||||
int rc, format;
|
||||
Atom type;
|
||||
Atom device_type;
|
||||
Atom types[N_WACOM_TYPE_ATOMS];
|
||||
GdkDeviceToolType tool_type = GDK_DEVICE_TOOL_TYPE_UNKNOWN;
|
||||
|
||||
display = gdk_device_get_display (device);
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
|
||||
rc = XIGetProperty (GDK_DISPLAY_XDISPLAY (display),
|
||||
gdk_x11_device_get_id (device),
|
||||
gdk_x11_get_xatom_by_name_for_display (display, "Wacom Tool Type"),
|
||||
0, 1, False, XA_ATOM, &type, &format, &nitems, &bytes_after,
|
||||
(guchar **) &data);
|
||||
gdk_x11_display_error_trap_pop_ignored (display);
|
||||
|
||||
if (rc != Success)
|
||||
return GDK_DEVICE_TOOL_TYPE_UNKNOWN;
|
||||
|
||||
if (type != XA_ATOM || format != 32 || nitems != 1)
|
||||
{
|
||||
XFree (data);
|
||||
return GDK_DEVICE_TOOL_TYPE_UNKNOWN;
|
||||
}
|
||||
|
||||
device_type = *data;
|
||||
XFree (data);
|
||||
|
||||
if (device_type == 0)
|
||||
return GDK_DEVICE_TOOL_TYPE_UNKNOWN;
|
||||
|
||||
gdk_x11_display_error_trap_push (display);
|
||||
rc = XInternAtoms (GDK_DISPLAY_XDISPLAY (display),
|
||||
(char **) wacom_type_atoms,
|
||||
N_WACOM_TYPE_ATOMS,
|
||||
False,
|
||||
types);
|
||||
gdk_x11_display_error_trap_pop_ignored (display);
|
||||
|
||||
if (rc == 0)
|
||||
return GDK_DEVICE_TOOL_TYPE_UNKNOWN;
|
||||
|
||||
if (device_type == types[WACOM_TYPE_STYLUS])
|
||||
tool_type = GDK_DEVICE_TOOL_TYPE_PEN;
|
||||
else if (device_type == types[WACOM_TYPE_CURSOR])
|
||||
tool_type = GDK_DEVICE_TOOL_TYPE_MOUSE;
|
||||
else if (device_type == types[WACOM_TYPE_ERASER])
|
||||
tool_type = GDK_DEVICE_TOOL_TYPE_ERASER;
|
||||
else if (device_type == types[WACOM_TYPE_TOUCH])
|
||||
tool_type = GDK_DEVICE_TOOL_TYPE_UNKNOWN;
|
||||
|
||||
return tool_type;
|
||||
}
|
||||
|
||||
static void
|
||||
handle_property_change (GdkX11DeviceManagerXI2 *device_manager,
|
||||
XIPropertyEvent *ev)
|
||||
@@ -1038,13 +1115,18 @@ handle_property_change (GdkX11DeviceManagerXI2 *device_manager,
|
||||
device_get_tool_serial_and_id (device, &serial_id, &tool_id))
|
||||
{
|
||||
seat = gdk_device_get_seat (device);
|
||||
tool = gdk_seat_get_tool (seat, serial_id);
|
||||
tool = gdk_seat_get_tool (seat, serial_id, tool_id);
|
||||
|
||||
if (!tool && serial_id > 0)
|
||||
{
|
||||
tool = gdk_device_tool_new (serial_id, tool_id,
|
||||
GDK_DEVICE_TOOL_TYPE_UNKNOWN, 0);
|
||||
gdk_seat_default_add_tool (GDK_SEAT_DEFAULT (seat), tool);
|
||||
GdkDeviceToolType tool_type;
|
||||
|
||||
tool_type = device_get_tool_type (device);
|
||||
if (tool_type != GDK_DEVICE_TOOL_TYPE_UNKNOWN)
|
||||
{
|
||||
tool = gdk_device_tool_new (serial_id, tool_id, tool_type, 0);
|
||||
gdk_seat_default_add_tool (GDK_SEAT_DEFAULT (seat), tool);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1728,7 +1728,7 @@ _gdk_x11_display_open (const gchar *display_name)
|
||||
if (!gdk_running_in_sandbox ())
|
||||
{
|
||||
/* if sandboxed, we're likely in a pid namespace and would only confuse the wm with this */
|
||||
pid_t pid = getpid ();
|
||||
long pid = getpid ();
|
||||
XChangeProperty (display_x11->xdisplay,
|
||||
display_x11->leader_window,
|
||||
gdk_x11_get_xatom_by_name_for_display (display, "_NET_WM_PID"),
|
||||
|
||||
@@ -935,7 +935,7 @@ setup_toplevel_window (GdkWindow *window,
|
||||
if (!gdk_running_in_sandbox ())
|
||||
{
|
||||
/* if sandboxed, we're likely in a pid namespace and would only confuse the wm with this */
|
||||
pid_t pid = getpid ();
|
||||
long pid = getpid ();
|
||||
XChangeProperty (xdisplay, xid,
|
||||
gdk_x11_get_xatom_by_name_for_display (x11_screen->display, "_NET_WM_PID"),
|
||||
XA_CARDINAL, 32,
|
||||
@@ -2985,6 +2985,7 @@ gdk_window_x11_set_background (GdkWindow *window,
|
||||
double r, g, b, a;
|
||||
cairo_surface_t *surface;
|
||||
cairo_matrix_t matrix;
|
||||
cairo_pattern_t *parent_relative_pattern;
|
||||
|
||||
if (GDK_WINDOW_DESTROYED (window))
|
||||
return;
|
||||
@@ -2997,15 +2998,18 @@ gdk_window_x11_set_background (GdkWindow *window,
|
||||
}
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
if (pattern == gdk_x11_get_parent_relative_pattern ())
|
||||
parent_relative_pattern = gdk_x11_get_parent_relative_pattern ();
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
if (pattern == parent_relative_pattern)
|
||||
{
|
||||
GdkWindow *parent;
|
||||
|
||||
/* 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 (parent != NULL && window->depth == parent->depth &&
|
||||
cairo_pattern_status (pattern) == CAIRO_STATUS_SUCCESS)
|
||||
{
|
||||
XSetWindowBackgroundPixmap (GDK_WINDOW_XDISPLAY (window),
|
||||
GDK_WINDOW_XID (window), ParentRelative);
|
||||
|
||||
@@ -46,11 +46,13 @@ static const struct {
|
||||
static GtkCellRendererState gtk_cell_accessible_get_state (GtkCellAccessible *cell);
|
||||
static void atk_action_interface_init (AtkActionIface *iface);
|
||||
static void atk_component_interface_init (AtkComponentIface *iface);
|
||||
static void atk_table_cell_interface_init (AtkTableCellIface *iface);
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkCellAccessible, gtk_cell_accessible, GTK_TYPE_ACCESSIBLE,
|
||||
G_ADD_PRIVATE (GtkCellAccessible)
|
||||
G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init)
|
||||
G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, atk_component_interface_init))
|
||||
G_IMPLEMENT_INTERFACE (ATK_TYPE_COMPONENT, atk_component_interface_init)
|
||||
G_IMPLEMENT_INTERFACE (ATK_TYPE_TABLE_CELL, atk_table_cell_interface_init))
|
||||
|
||||
static gint
|
||||
gtk_cell_accessible_get_index_in_parent (AtkObject *obj)
|
||||
@@ -366,6 +368,90 @@ atk_component_interface_init (AtkComponentIface *iface)
|
||||
iface->grab_focus = gtk_cell_accessible_grab_focus;
|
||||
}
|
||||
|
||||
static int
|
||||
gtk_cell_accessible_get_column_span (AtkTableCell *table_cell)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static GPtrArray *
|
||||
gtk_cell_accessible_get_column_header_cells (AtkTableCell *table_cell)
|
||||
{
|
||||
GtkCellAccessible *cell;
|
||||
AtkObject *parent;
|
||||
|
||||
cell = GTK_CELL_ACCESSIBLE (table_cell);
|
||||
parent = gtk_widget_get_accessible (gtk_accessible_get_widget (GTK_ACCESSIBLE (cell)));
|
||||
|
||||
return gtk_cell_accessible_parent_get_column_header_cells (GTK_CELL_ACCESSIBLE_PARENT (parent),
|
||||
cell);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_cell_accessible_get_position (AtkTableCell *table_cell,
|
||||
gint *row,
|
||||
gint *column)
|
||||
{
|
||||
GtkCellAccessible *cell;
|
||||
AtkObject *parent;
|
||||
|
||||
cell = GTK_CELL_ACCESSIBLE (table_cell);
|
||||
parent = gtk_widget_get_accessible (gtk_accessible_get_widget (GTK_ACCESSIBLE (cell)));
|
||||
|
||||
gtk_cell_accessible_parent_get_cell_position (GTK_CELL_ACCESSIBLE_PARENT (parent),
|
||||
cell,
|
||||
row, column);
|
||||
return ((row && *row > 0) || (column && *column > 0));
|
||||
}
|
||||
|
||||
static int
|
||||
gtk_cell_accessible_get_row_span (AtkTableCell *table_cell)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static GPtrArray *
|
||||
gtk_cell_accessible_get_row_header_cells (AtkTableCell *table_cell)
|
||||
{
|
||||
GtkCellAccessible *cell;
|
||||
AtkObject *parent;
|
||||
|
||||
cell = GTK_CELL_ACCESSIBLE (table_cell);
|
||||
parent = gtk_widget_get_accessible (gtk_accessible_get_widget (GTK_ACCESSIBLE (cell)));
|
||||
|
||||
return gtk_cell_accessible_parent_get_row_header_cells (GTK_CELL_ACCESSIBLE_PARENT (parent),
|
||||
cell);
|
||||
}
|
||||
|
||||
static AtkObject *
|
||||
gtk_cell_accessible_get_table (AtkTableCell *table_cell)
|
||||
{
|
||||
AtkObject *obj;
|
||||
|
||||
obj = ATK_OBJECT (table_cell);
|
||||
do
|
||||
{
|
||||
AtkRole role;
|
||||
obj = atk_object_get_parent (obj);
|
||||
role = atk_object_get_role (obj);
|
||||
if (role == ATK_ROLE_TABLE || role == ATK_ROLE_TREE_TABLE)
|
||||
break;
|
||||
}
|
||||
while (obj);
|
||||
return obj;
|
||||
}
|
||||
|
||||
static void
|
||||
atk_table_cell_interface_init (AtkTableCellIface *iface)
|
||||
{
|
||||
iface->get_column_span = gtk_cell_accessible_get_column_span;
|
||||
iface->get_column_header_cells = gtk_cell_accessible_get_column_header_cells;
|
||||
iface->get_position = gtk_cell_accessible_get_position;
|
||||
iface->get_row_span = gtk_cell_accessible_get_row_span;
|
||||
iface->get_row_header_cells = gtk_cell_accessible_get_row_header_cells;
|
||||
iface->get_table = gtk_cell_accessible_get_table;
|
||||
}
|
||||
|
||||
static GtkCellRendererState
|
||||
gtk_cell_accessible_get_state (GtkCellAccessible *cell)
|
||||
{
|
||||
|
||||
@@ -187,3 +187,69 @@ gtk_cell_accessible_parent_update_relationset (GtkCellAccessibleParent *parent,
|
||||
if (iface->update_relationset)
|
||||
(iface->update_relationset) (parent, cell, relationset);
|
||||
}
|
||||
|
||||
void
|
||||
gtk_cell_accessible_parent_get_cell_position (GtkCellAccessibleParent *parent,
|
||||
GtkCellAccessible *cell,
|
||||
gint *row,
|
||||
gint *column)
|
||||
{
|
||||
GtkCellAccessibleParentIface *iface;
|
||||
|
||||
g_return_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent));
|
||||
g_return_if_fail (GTK_IS_CELL_ACCESSIBLE (cell));
|
||||
|
||||
iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
|
||||
|
||||
if (iface->get_cell_position)
|
||||
(iface->get_cell_position) (parent, cell, row, column);
|
||||
else
|
||||
{
|
||||
if (row)
|
||||
*row = -1;
|
||||
if (column)
|
||||
*column = -1;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_cell_accessible_parent_get_column_header_cells:
|
||||
* Returns: (transfer full) (element-type AtkObject)
|
||||
*/
|
||||
GPtrArray *
|
||||
gtk_cell_accessible_parent_get_column_header_cells (GtkCellAccessibleParent *parent,
|
||||
GtkCellAccessible *cell)
|
||||
{
|
||||
GtkCellAccessibleParentIface *iface;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent), NULL);
|
||||
g_return_val_if_fail (GTK_IS_CELL_ACCESSIBLE (cell), NULL);
|
||||
|
||||
iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
|
||||
|
||||
if (iface->get_column_header_cells)
|
||||
return (iface->get_column_header_cells) (parent, cell);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_cell_accessible_parent_get_row_header_cells:
|
||||
* Returns: (transfer full) (element-type AtkObject)
|
||||
*/
|
||||
GPtrArray *
|
||||
gtk_cell_accessible_parent_get_row_header_cells (GtkCellAccessibleParent *parent,
|
||||
GtkCellAccessible *cell)
|
||||
{
|
||||
GtkCellAccessibleParentIface *iface;
|
||||
|
||||
g_return_val_if_fail (GTK_IS_CELL_ACCESSIBLE_PARENT (parent), NULL);
|
||||
g_return_val_if_fail (GTK_IS_CELL_ACCESSIBLE (cell), NULL);
|
||||
|
||||
iface = GTK_CELL_ACCESSIBLE_PARENT_GET_IFACE (parent);
|
||||
|
||||
if (iface->get_row_header_cells)
|
||||
return (iface->get_row_header_cells) (parent, cell);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -75,6 +75,14 @@ struct _GtkCellAccessibleParentIface
|
||||
void ( *update_relationset) (GtkCellAccessibleParent *parent,
|
||||
GtkCellAccessible *cell,
|
||||
AtkRelationSet *relationset);
|
||||
void ( *get_cell_position) (GtkCellAccessibleParent *parent,
|
||||
GtkCellAccessible *cell,
|
||||
gint *row,
|
||||
gint *column);
|
||||
GPtrArray * ( *get_column_header_cells) (GtkCellAccessibleParent *parent,
|
||||
GtkCellAccessible *cell);
|
||||
GPtrArray * ( *get_row_header_cells) (GtkCellAccessibleParent *parent,
|
||||
GtkCellAccessible *cell);
|
||||
};
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
@@ -115,6 +123,17 @@ GDK_AVAILABLE_IN_3_12
|
||||
void gtk_cell_accessible_parent_update_relationset (GtkCellAccessibleParent *parent,
|
||||
GtkCellAccessible *cell,
|
||||
AtkRelationSet *relationset);
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
void gtk_cell_accessible_parent_get_cell_position(GtkCellAccessibleParent *parent,
|
||||
GtkCellAccessible *cell,
|
||||
gint *row,
|
||||
gint *column);
|
||||
|
||||
GPtrArray *gtk_cell_accessible_parent_get_column_header_cells (GtkCellAccessibleParent *parent,
|
||||
GtkCellAccessible *cell);
|
||||
|
||||
GPtrArray *gtk_cell_accessible_parent_get_row_header_cells (GtkCellAccessibleParent *parent,
|
||||
GtkCellAccessible *cell);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -1391,6 +1391,56 @@ gtk_tree_view_accessible_update_relationset (GtkCellAccessibleParent *parent,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_tree_view_accessible_get_cell_position (GtkCellAccessibleParent *parent,
|
||||
GtkCellAccessible *cell,
|
||||
gint *row,
|
||||
gint *column)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
GtkTreeView *tree_view;
|
||||
GtkTreeViewAccessibleCellInfo *cell_info;
|
||||
GtkTreeViewAccessible *accessible;
|
||||
|
||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (parent));
|
||||
if (widget == NULL)
|
||||
return;
|
||||
|
||||
tree_view = GTK_TREE_VIEW (widget);
|
||||
accessible = GTK_TREE_VIEW_ACCESSIBLE (parent);
|
||||
cell_info = find_cell_info (accessible, cell);
|
||||
if (!cell_info)
|
||||
return;
|
||||
|
||||
if (row)
|
||||
(*row) = _gtk_rbtree_node_get_index (cell_info->tree, cell_info->node);
|
||||
if (column)
|
||||
(*column) = get_column_number (tree_view, cell_info->cell_col_ref);
|
||||
}
|
||||
|
||||
static GPtrArray *
|
||||
gtk_tree_view_accessible_get_column_header_cells (GtkCellAccessibleParent *parent,
|
||||
GtkCellAccessible *cell)
|
||||
{
|
||||
GtkWidget *widget;
|
||||
GtkTreeViewAccessibleCellInfo *cell_info;
|
||||
GtkTreeViewAccessible *accessible;
|
||||
GPtrArray *array;
|
||||
|
||||
widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (parent));
|
||||
if (widget == NULL)
|
||||
return NULL;
|
||||
|
||||
accessible = GTK_TREE_VIEW_ACCESSIBLE (parent);
|
||||
cell_info = find_cell_info (accessible, cell);
|
||||
if (!cell_info)
|
||||
return NULL;
|
||||
|
||||
array = g_ptr_array_new_full (1, g_object_unref);
|
||||
g_ptr_array_add (array, g_object_ref (get_header_from_column ( (cell_info->cell_col_ref))));
|
||||
return array;
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_cell_accessible_parent_interface_init (GtkCellAccessibleParentIface *iface)
|
||||
{
|
||||
@@ -1403,6 +1453,8 @@ gtk_cell_accessible_parent_interface_init (GtkCellAccessibleParentIface *iface)
|
||||
iface->activate = gtk_tree_view_accessible_activate;
|
||||
iface->edit = gtk_tree_view_accessible_edit;
|
||||
iface->update_relationset = gtk_tree_view_accessible_update_relationset;
|
||||
iface->get_cell_position = gtk_tree_view_accessible_get_cell_position;
|
||||
iface->get_column_header_cells = gtk_tree_view_accessible_get_column_header_cells;
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -1420,7 +1420,9 @@ gtk_status_icon_update_image (GtkStatusIcon *status_icon)
|
||||
surface = gtk_icon_helper_load_surface (icon_helper, 1);
|
||||
if (surface)
|
||||
{
|
||||
pixbuf = gdk_pixbuf_get_from_surface (surface, 0, 0, round_size, round_size);
|
||||
pixbuf = gdk_pixbuf_get_from_surface (surface, 0, 0,
|
||||
cairo_image_surface_get_width (surface),
|
||||
cairo_image_surface_get_height (surface));
|
||||
cairo_surface_destroy (surface);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -421,7 +421,7 @@ gtk_application_impl_dbus_startup (GtkApplicationImpl *impl,
|
||||
"gtk-shell-shows-menubar", FALSE,
|
||||
NULL);
|
||||
|
||||
if (dbus->sm_proxy == NULL)
|
||||
if (dbus->sm_proxy == NULL && dbus->session)
|
||||
{
|
||||
dbus->inhibit_proxy = gtk_application_get_proxy_if_service_present (dbus->session,
|
||||
G_DBUS_PROXY_FLAGS_NONE,
|
||||
|
||||
@@ -17,6 +17,18 @@
|
||||
* Author(s): Carlos Garnacho <carlosg@gnome.org>
|
||||
*/
|
||||
|
||||
/**
|
||||
* SECTION:gtkeventcontrollerkey
|
||||
* @Short_description: Event controller for key events
|
||||
* @Title: GtkEventControllerKey
|
||||
* @See_also: #GtkEventController
|
||||
*
|
||||
* #GtkEventControllerKey is an event controller meant for situations
|
||||
* where you need access to key events.
|
||||
*
|
||||
* This object was added in 3.24.
|
||||
**/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "gtkintl.h"
|
||||
@@ -153,12 +165,37 @@ gtk_event_controller_key_class_init (GtkEventControllerKeyClass *klass)
|
||||
object_class->finalize = gtk_event_controller_finalize;
|
||||
controller_class->handle_event = gtk_event_controller_key_handle_event;
|
||||
|
||||
/**
|
||||
* GtkEventControllerKey::key-pressed:
|
||||
* @controller: the object which received the signal.
|
||||
* @keyval: the pressed key.
|
||||
* @keycode: the raw code of the pressed key.
|
||||
* @state: the bitmask, representing the state of modifier keys and pointer buttons. See #GdkModifierType.
|
||||
*
|
||||
* This signal is emitted whenever a key is pressed.
|
||||
*
|
||||
* Returns: %TRUE if the key press was handled, %FALSE otherwise.
|
||||
*
|
||||
* Since: 3.24
|
||||
*/
|
||||
signals[KEY_PRESSED] =
|
||||
g_signal_new (I_("key-pressed"),
|
||||
GTK_TYPE_EVENT_CONTROLLER_KEY,
|
||||
G_SIGNAL_RUN_LAST,
|
||||
0, _gtk_boolean_handled_accumulator, NULL, NULL,
|
||||
G_TYPE_BOOLEAN, 3, G_TYPE_UINT, G_TYPE_UINT, GDK_TYPE_MODIFIER_TYPE);
|
||||
|
||||
/**
|
||||
* GtkEventControllerKey::key-released:
|
||||
* @controller: the object which received the signal.
|
||||
* @keyval: the released key.
|
||||
* @keycode: the raw code of the released key.
|
||||
* @state: the bitmask, representing the state of modifier keys and pointer buttons. See #GdkModifierType.
|
||||
*
|
||||
* This signal is emitted whenever a key is released.
|
||||
*
|
||||
* Since: 3.24
|
||||
*/
|
||||
signals[KEY_RELEASED] =
|
||||
g_signal_new (I_("key-released"),
|
||||
GTK_TYPE_EVENT_CONTROLLER_KEY,
|
||||
|
||||
@@ -58,8 +58,11 @@
|
||||
#include <hb.h>
|
||||
#include <hb-ot.h>
|
||||
#include <hb-ft.h>
|
||||
#include <freetype/freetype.h>
|
||||
#include <freetype/ftmm.h>
|
||||
|
||||
#include <ft2build.h>
|
||||
#include FT_FREETYPE_H
|
||||
#include FT_MULTIPLE_MASTERS_H
|
||||
|
||||
#include "language-names.h"
|
||||
#include "script-names.h"
|
||||
#endif
|
||||
|
||||
+3
-2
@@ -32,8 +32,9 @@
|
||||
#ifndef S_ISDIR
|
||||
#define S_ISDIR(mode) ((mode)&_S_IFDIR)
|
||||
#endif
|
||||
#define WIN32_MEAN_AND_LEAN
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <windows.h>
|
||||
#include <shellapi.h>
|
||||
#include "win32/gdkwin32.h"
|
||||
#endif /* G_OS_WIN32 */
|
||||
|
||||
@@ -4568,7 +4569,7 @@ gtk_icon_info_load_symbolic_svg (GtkIconInfo *icon_info,
|
||||
" width=\"", width, "\"\n"
|
||||
" height=\"", height, "\">\n"
|
||||
" <style type=\"text/css\">\n"
|
||||
" rect,path,ellipse,circle {\n"
|
||||
" rect,path,ellipse,circle,polygon {\n"
|
||||
" fill: ", css_fg," !important;\n"
|
||||
" }\n"
|
||||
" .warning {\n"
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@
|
||||
G_BEGIN_DECLS
|
||||
|
||||
/**
|
||||
* GTK_PRIORITY_RESIZE:
|
||||
* GTK_PRIORITY_RESIZE: (value 110)
|
||||
*
|
||||
* Use this priority for functionality related to size allocation.
|
||||
*
|
||||
|
||||
@@ -2084,6 +2084,9 @@ drag_data_received_callback (GtkWidget *list_box,
|
||||
|
||||
source_row = (void*) gtk_selection_data_get_data (selection_data);
|
||||
|
||||
if (sidebar->row_placeholder != NULL)
|
||||
g_object_get (sidebar->row_placeholder, "order-index", &target_order_index, NULL);
|
||||
|
||||
reorder_bookmarks (sidebar, GTK_SIDEBAR_ROW (*source_row), target_order_index);
|
||||
success = TRUE;
|
||||
}
|
||||
|
||||
@@ -72,6 +72,7 @@ struct _GtkPlacesViewPrivate
|
||||
GtkWidget *recent_servers_stack;
|
||||
GtkWidget *stack;
|
||||
GtkWidget *server_adresses_popover;
|
||||
GtkWidget *available_protocols_grid;
|
||||
GtkWidget *network_placeholder;
|
||||
GtkWidget *network_placeholder_label;
|
||||
|
||||
@@ -1605,6 +1606,54 @@ unmount_cb (GtkMenuItem *item,
|
||||
unmount_mount (GTK_PLACES_VIEW (view), mount);
|
||||
}
|
||||
|
||||
static void
|
||||
attach_protocol_row_to_grid (GtkGrid *grid,
|
||||
const gchar *protocol_name,
|
||||
const gchar *protocol_prefix)
|
||||
{
|
||||
GtkWidget *name_label;
|
||||
GtkWidget *prefix_label;
|
||||
|
||||
name_label = gtk_label_new (protocol_name);
|
||||
gtk_widget_set_halign (name_label, GTK_ALIGN_START);
|
||||
gtk_grid_attach_next_to (grid, name_label, NULL, GTK_POS_BOTTOM, 1, 1);
|
||||
|
||||
prefix_label = gtk_label_new (protocol_prefix);
|
||||
gtk_widget_set_halign (prefix_label, GTK_ALIGN_START);
|
||||
gtk_grid_attach_next_to (grid, prefix_label, name_label, GTK_POS_RIGHT, 1, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
populate_available_protocols_grid (GtkGrid *grid)
|
||||
{
|
||||
const gchar* const *supported_protocols;
|
||||
|
||||
supported_protocols = g_vfs_get_supported_uri_schemes (g_vfs_get_default ());
|
||||
|
||||
if (g_strv_contains (supported_protocols, "afp"))
|
||||
attach_protocol_row_to_grid (grid, _("AppleTalk"), "afp://");
|
||||
|
||||
if (g_strv_contains (supported_protocols, "ftp"))
|
||||
/* Translators: do not translate ftp:// and ftps:// */
|
||||
attach_protocol_row_to_grid (grid, _("File Transfer Protocol"), _("ftp:// or ftps://"));
|
||||
|
||||
if (g_strv_contains (supported_protocols, "nfs"))
|
||||
attach_protocol_row_to_grid (grid, _("Network File System"), "nfs://");
|
||||
|
||||
if (g_strv_contains (supported_protocols, "smb"))
|
||||
attach_protocol_row_to_grid (grid, _("Samba"), "smb://");
|
||||
|
||||
if (g_strv_contains (supported_protocols, "ssh"))
|
||||
/* Translators: do not translate sftp:// and ssh:// */
|
||||
attach_protocol_row_to_grid (grid, _("SSH File Transfer Protocol"), _("sftp:// or ssh://"));
|
||||
|
||||
if (g_strv_contains (supported_protocols, "dav"))
|
||||
/* Translators: do not translate dav:// and davs:// */
|
||||
attach_protocol_row_to_grid (grid, _("WebDAV"), _("dav:// or davs://"));
|
||||
|
||||
gtk_widget_show_all (GTK_WIDGET (grid));
|
||||
}
|
||||
|
||||
/* Constructs the popup menu if needed */
|
||||
static void
|
||||
build_popup_menu (GtkPlacesView *view,
|
||||
@@ -1855,6 +1904,13 @@ on_address_entry_text_changed (GtkPlacesView *view)
|
||||
|
||||
out:
|
||||
gtk_widget_set_sensitive (priv->connect_button, supported);
|
||||
if (scheme && !supported)
|
||||
gtk_style_context_add_class (gtk_widget_get_style_context (priv->address_entry),
|
||||
GTK_STYLE_CLASS_ERROR);
|
||||
else
|
||||
gtk_style_context_remove_class (gtk_widget_get_style_context (priv->address_entry),
|
||||
GTK_STYLE_CLASS_ERROR);
|
||||
|
||||
g_free (address);
|
||||
g_free (scheme);
|
||||
}
|
||||
@@ -2302,6 +2358,7 @@ gtk_places_view_class_init (GtkPlacesViewClass *klass)
|
||||
gtk_widget_class_bind_template_child_private (widget_class, GtkPlacesView, recent_servers_stack);
|
||||
gtk_widget_class_bind_template_child_private (widget_class, GtkPlacesView, stack);
|
||||
gtk_widget_class_bind_template_child_private (widget_class, GtkPlacesView, server_adresses_popover);
|
||||
gtk_widget_class_bind_template_child_private (widget_class, GtkPlacesView, available_protocols_grid);
|
||||
|
||||
gtk_widget_class_bind_template_callback (widget_class, on_address_entry_text_changed);
|
||||
gtk_widget_class_bind_template_callback (widget_class, on_address_entry_show_help_pressed);
|
||||
@@ -2326,6 +2383,8 @@ gtk_places_view_init (GtkPlacesView *self)
|
||||
priv->space_size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
|
||||
|
||||
gtk_widget_init_template (GTK_WIDGET (self));
|
||||
|
||||
populate_available_protocols_grid (GTK_GRID (priv->available_protocols_grid));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+5
-6
@@ -449,7 +449,7 @@ gtk_revealer_real_size_allocate (GtkWidget *widget,
|
||||
GtkRevealerPrivate *priv = gtk_revealer_get_instance_private (revealer);
|
||||
GtkAllocation child_allocation;
|
||||
GtkWidget *child;
|
||||
gboolean window_visible;
|
||||
gboolean child_visible, window_visible;
|
||||
int bin_x, bin_y;
|
||||
GtkRevealerTransitionType transition;
|
||||
GtkBorder padding;
|
||||
@@ -460,7 +460,9 @@ gtk_revealer_real_size_allocate (GtkWidget *widget,
|
||||
gtk_revealer_get_child_allocation (revealer, allocation, &child_allocation);
|
||||
|
||||
child = gtk_bin_get_child (GTK_BIN (revealer));
|
||||
if (child != NULL && gtk_widget_get_visible (child))
|
||||
child_visible = child != NULL && gtk_widget_get_visible (child) &&
|
||||
gtk_widget_get_child_visible (child);
|
||||
if (child_visible)
|
||||
gtk_widget_size_allocate (child, &child_allocation);
|
||||
|
||||
if (gtk_widget_get_realized (widget))
|
||||
@@ -633,10 +635,7 @@ gtk_revealer_stop_animation (GtkRevealer *revealer)
|
||||
{
|
||||
GtkRevealerPrivate *priv = gtk_revealer_get_instance_private (revealer);
|
||||
if (priv->current_pos != priv->target_pos)
|
||||
{
|
||||
priv->current_pos = priv->target_pos;
|
||||
g_object_notify_by_pspec (G_OBJECT (revealer), props[PROP_CHILD_REVEALED]);
|
||||
}
|
||||
gtk_revealer_set_position (revealer, priv->target_pos);
|
||||
if (priv->tick_id != 0)
|
||||
{
|
||||
gtk_widget_remove_tick_callback (GTK_WIDGET (revealer), priv->tick_id);
|
||||
|
||||
@@ -246,6 +246,8 @@ iter_init_common (GtkTextIter *_iter,
|
||||
g_return_val_if_fail (iter != NULL, NULL);
|
||||
g_return_val_if_fail (tree != NULL, NULL);
|
||||
|
||||
memset (iter, 0, sizeof (GtkTextRealIter));
|
||||
|
||||
iter->tree = tree;
|
||||
|
||||
iter->chars_changed_stamp =
|
||||
|
||||
+1
-1
@@ -103,7 +103,7 @@ typedef enum
|
||||
} GtkTextExtendSelection;
|
||||
|
||||
/**
|
||||
* GTK_TEXT_VIEW_PRIORITY_VALIDATE:
|
||||
* GTK_TEXT_VIEW_PRIORITY_VALIDATE: (value 125)
|
||||
*
|
||||
* The priority at which the text view validates onscreen lines
|
||||
* in an idle job in the background.
|
||||
|
||||
+1
-133
@@ -65,7 +65,7 @@
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<object class="GtkGrid" id="available_protocols_grid">
|
||||
<property name="visible">1</property>
|
||||
<property name="margin-top">12</property>
|
||||
<property name="hexpand">1</property>
|
||||
@@ -86,72 +86,6 @@
|
||||
<property name="top-attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes">AppleTalk</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes">File Transfer Protocol</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes">Network File System</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes">Samba</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes">SSH File Transfer Protocol</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes">WebDAV</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">0</property>
|
||||
<property name="top-attach">6</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">1</property>
|
||||
@@ -166,72 +100,6 @@
|
||||
<property name="top-attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">1</property>
|
||||
<property name="label">afp://</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes" comments="Translators: do not translate ftp:// and ftps://">ftp:// or ftps://</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">1</property>
|
||||
<property name="label">nfs://</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes">smb://</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">4</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes" comments="Translators: do not translate sftp:// and ssh://">sftp:// or ssh://</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">5</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel">
|
||||
<property name="visible">1</property>
|
||||
<property name="label" translatable="yes" comments="Translators: do not translate dav:// and davs://">dav:// or davs://</property>
|
||||
<property name="xalign">0</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left-attach">1</property>
|
||||
<property name="top-attach">6</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="position">3</property>
|
||||
|
||||
+189
-106
@@ -42,6 +42,10 @@ struct _GtkIMContextWaylandGlobal
|
||||
|
||||
GtkIMContext *current;
|
||||
|
||||
/* The input-method.enter event may happen before or after GTK focus-in,
|
||||
* so the context may not exist at the time. Same for leave and focus-out. */
|
||||
gboolean focused;
|
||||
|
||||
guint serial;
|
||||
};
|
||||
|
||||
@@ -128,18 +132,6 @@ notify_external_change (GtkIMContextWayland *context)
|
||||
g_signal_emit_by_name (global->current, "retrieve-surrounding", &result);
|
||||
}
|
||||
|
||||
static void
|
||||
text_input_enter (void *data,
|
||||
struct zwp_text_input_v3 *text_input,
|
||||
struct wl_surface *surface)
|
||||
{}
|
||||
|
||||
static void
|
||||
text_input_leave (void *data,
|
||||
struct zwp_text_input_v3 *text_input,
|
||||
struct wl_surface *surface)
|
||||
{}
|
||||
|
||||
static void
|
||||
text_input_preedit (void *data,
|
||||
struct zwp_text_input_v3 *text_input,
|
||||
@@ -274,74 +266,14 @@ text_input_done (void *data,
|
||||
text_input_preedit_apply(global);
|
||||
}
|
||||
|
||||
static const struct zwp_text_input_v3_listener text_input_listener = {
|
||||
text_input_enter,
|
||||
text_input_leave,
|
||||
text_input_preedit,
|
||||
text_input_commit,
|
||||
text_input_delete_surrounding_text,
|
||||
text_input_done,
|
||||
};
|
||||
|
||||
static void
|
||||
registry_handle_global (void *data,
|
||||
struct wl_registry *registry,
|
||||
uint32_t id,
|
||||
const char *interface,
|
||||
uint32_t version)
|
||||
{
|
||||
GtkIMContextWaylandGlobal *global = data;
|
||||
GdkSeat *seat = gdk_display_get_default_seat (gdk_display_get_default ());
|
||||
|
||||
if (strcmp (interface, "zwp_text_input_manager_v3") == 0)
|
||||
{
|
||||
global->text_input_manager_wl_id = id;
|
||||
global->text_input_manager =
|
||||
wl_registry_bind (global->registry, global->text_input_manager_wl_id,
|
||||
&zwp_text_input_manager_v3_interface, 1);
|
||||
global->text_input =
|
||||
zwp_text_input_manager_v3_get_text_input (global->text_input_manager,
|
||||
gdk_wayland_seat_get_wl_seat (seat));
|
||||
global->serial = 0;
|
||||
zwp_text_input_v3_add_listener (global->text_input,
|
||||
&text_input_listener, global);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
registry_handle_global_remove (void *data,
|
||||
struct wl_registry *registry,
|
||||
uint32_t id)
|
||||
{
|
||||
GtkIMContextWaylandGlobal *global = data;
|
||||
|
||||
if (id != global->text_input_manager_wl_id)
|
||||
return;
|
||||
|
||||
g_clear_pointer(&global->text_input, zwp_text_input_v3_destroy);
|
||||
g_clear_pointer(&global->text_input_manager, zwp_text_input_manager_v3_destroy);
|
||||
}
|
||||
|
||||
static const struct wl_registry_listener registry_listener = {
|
||||
registry_handle_global,
|
||||
registry_handle_global_remove
|
||||
};
|
||||
|
||||
static void
|
||||
gtk_im_context_wayland_global_init (GdkDisplay *display)
|
||||
{
|
||||
g_return_if_fail (global == NULL);
|
||||
|
||||
global = g_new0 (GtkIMContextWaylandGlobal, 1);
|
||||
global->display = gdk_wayland_display_get_wl_display (display);
|
||||
global->registry = wl_display_get_registry (global->display);
|
||||
|
||||
wl_registry_add_listener (global->registry, ®istry_listener, global);
|
||||
}
|
||||
|
||||
static void
|
||||
notify_surrounding_text (GtkIMContextWayland *context)
|
||||
{
|
||||
#define MAX_LEN 4000
|
||||
const gchar *start, *end;
|
||||
int len, cursor, anchor;
|
||||
char *str = NULL;
|
||||
|
||||
if (!global || !global->text_input)
|
||||
return;
|
||||
if (global->current != GTK_IM_CONTEXT (context))
|
||||
@@ -349,12 +281,67 @@ notify_surrounding_text (GtkIMContextWayland *context)
|
||||
if (!context->surrounding.text)
|
||||
return;
|
||||
|
||||
len = strlen (context->surrounding.text);
|
||||
cursor = context->surrounding.cursor_idx;
|
||||
anchor = context->surrounding.anchor_idx;
|
||||
|
||||
/* The protocol specifies a maximum length of 4KiB on transfers,
|
||||
* mangle the surrounding text if it's bigger than that, and relocate
|
||||
* cursor/anchor locations as per the string being sent.
|
||||
*/
|
||||
if (len > MAX_LEN)
|
||||
{
|
||||
if (context->surrounding.cursor_idx < MAX_LEN &&
|
||||
context->surrounding.anchor_idx < MAX_LEN)
|
||||
{
|
||||
start = context->surrounding.text;
|
||||
end = &context->surrounding.text[MAX_LEN];
|
||||
}
|
||||
else if (context->surrounding.cursor_idx > len - MAX_LEN &&
|
||||
context->surrounding.cursor_idx > len - MAX_LEN)
|
||||
{
|
||||
start = &context->surrounding.text[len - MAX_LEN];
|
||||
end = &context->surrounding.text[len];
|
||||
}
|
||||
else
|
||||
{
|
||||
int mid, a, b;
|
||||
int cursor_len = ABS (context->surrounding.cursor_idx -
|
||||
context->surrounding.anchor_idx);
|
||||
|
||||
if (cursor_len > MAX_LEN)
|
||||
{
|
||||
g_warn_if_reached ();
|
||||
return;
|
||||
}
|
||||
|
||||
mid = MIN (context->surrounding.cursor_idx,
|
||||
context->surrounding.cursor_idx) + (cursor_len / 2);
|
||||
a = MAX (0, mid - (MAX_LEN / 2));
|
||||
b = MIN (MAX_LEN, mid + (MAX_LEN / 2));
|
||||
|
||||
start = &context->surrounding.text[a];
|
||||
end = &context->surrounding.text[b];
|
||||
}
|
||||
|
||||
if (start != context->surrounding.text)
|
||||
start = g_utf8_next_char (start);
|
||||
if (end != &context->surrounding.text[len])
|
||||
end = g_utf8_find_prev_char (context->surrounding.text, end);
|
||||
|
||||
cursor -= start - context->surrounding.text;
|
||||
anchor -= start - context->surrounding.text;
|
||||
|
||||
str = g_strndup (start, end - start);
|
||||
}
|
||||
|
||||
zwp_text_input_v3_set_surrounding_text (global->text_input,
|
||||
context->surrounding.text,
|
||||
context->surrounding.cursor_idx,
|
||||
context->surrounding.anchor_idx);
|
||||
str ? str : context->surrounding.text,
|
||||
cursor, anchor);
|
||||
zwp_text_input_v3_set_text_change_cause (global->text_input,
|
||||
context->surrounding_change);
|
||||
g_free (str);
|
||||
#undef MAX_LEN
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -466,12 +453,6 @@ commit_state (GtkIMContextWayland *context)
|
||||
context->surrounding_change = ZWP_TEXT_INPUT_V3_CHANGE_CAUSE_INPUT_METHOD;
|
||||
}
|
||||
|
||||
static void
|
||||
enable_text_input (GtkIMContextWayland *context)
|
||||
{
|
||||
zwp_text_input_v3_enable (global->text_input);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_im_context_wayland_finalize (GObject *object)
|
||||
{
|
||||
@@ -516,14 +497,15 @@ released_cb (GtkGestureMultiPress *gesture,
|
||||
|
||||
g_object_get (context, "input-hints", &hints, NULL);
|
||||
|
||||
if (n_press == 1 &&
|
||||
if (global->focused &&
|
||||
n_press == 1 &&
|
||||
(hints & GTK_INPUT_HINT_INHIBIT_OSK) == 0 &&
|
||||
!gtk_drag_check_threshold (context->widget,
|
||||
context->press_x,
|
||||
context->press_y,
|
||||
x, y))
|
||||
{
|
||||
enable_text_input (GTK_IM_CONTEXT_WAYLAND (context));
|
||||
zwp_text_input_v3_enable (global->text_input);
|
||||
g_signal_emit_by_name (global->current, "retrieve-surrounding", &result);
|
||||
commit_state (context);
|
||||
}
|
||||
@@ -627,18 +609,10 @@ gtk_im_context_wayland_filter_keypress (GtkIMContext *context,
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_im_context_wayland_focus_in (GtkIMContext *context)
|
||||
enable (GtkIMContextWayland *context_wayland)
|
||||
{
|
||||
GtkIMContextWayland *context_wayland = GTK_IM_CONTEXT_WAYLAND (context);
|
||||
gboolean result;
|
||||
|
||||
if (global->current == context)
|
||||
return;
|
||||
if (!global->text_input)
|
||||
return;
|
||||
|
||||
global->current = context;
|
||||
enable_text_input (context_wayland);
|
||||
zwp_text_input_v3_enable (global->text_input);
|
||||
g_signal_emit_by_name (global->current, "retrieve-surrounding", &result);
|
||||
notify_content_type (context_wayland);
|
||||
notify_cursor_location (context_wayland);
|
||||
@@ -646,15 +620,8 @@ gtk_im_context_wayland_focus_in (GtkIMContext *context)
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_im_context_wayland_focus_out (GtkIMContext *context)
|
||||
disable (GtkIMContextWayland *context_wayland)
|
||||
{
|
||||
GtkIMContextWayland *context_wayland;
|
||||
|
||||
if (global->current != context)
|
||||
return;
|
||||
|
||||
context_wayland = GTK_IM_CONTEXT_WAYLAND (context);
|
||||
|
||||
zwp_text_input_v3_disable (global->text_input);
|
||||
commit_state (context_wayland);
|
||||
|
||||
@@ -664,6 +631,122 @@ gtk_im_context_wayland_focus_out (GtkIMContext *context)
|
||||
text_input_preedit (global, global->text_input, NULL, 0, 0);
|
||||
text_input_preedit_apply (global);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
text_input_enter (void *data,
|
||||
struct zwp_text_input_v3 *text_input,
|
||||
struct wl_surface *surface)
|
||||
{
|
||||
global->focused = TRUE;
|
||||
|
||||
if (global->current)
|
||||
enable (GTK_IM_CONTEXT_WAYLAND (global->current));
|
||||
}
|
||||
|
||||
static void
|
||||
text_input_leave (void *data,
|
||||
struct zwp_text_input_v3 *text_input,
|
||||
struct wl_surface *surface)
|
||||
{
|
||||
global->focused = FALSE;
|
||||
|
||||
if (global->current)
|
||||
disable (GTK_IM_CONTEXT_WAYLAND (global->current));
|
||||
}
|
||||
|
||||
|
||||
static const struct zwp_text_input_v3_listener text_input_listener = {
|
||||
text_input_enter,
|
||||
text_input_leave,
|
||||
text_input_preedit,
|
||||
text_input_commit,
|
||||
text_input_delete_surrounding_text,
|
||||
text_input_done,
|
||||
};
|
||||
|
||||
static void
|
||||
registry_handle_global (void *data,
|
||||
struct wl_registry *registry,
|
||||
uint32_t id,
|
||||
const char *interface,
|
||||
uint32_t version)
|
||||
{
|
||||
GtkIMContextWaylandGlobal *global = data;
|
||||
GdkSeat *seat = gdk_display_get_default_seat (gdk_display_get_default ());
|
||||
|
||||
if (strcmp (interface, "zwp_text_input_manager_v3") == 0)
|
||||
{
|
||||
global->text_input_manager_wl_id = id;
|
||||
global->text_input_manager =
|
||||
wl_registry_bind (global->registry, global->text_input_manager_wl_id,
|
||||
&zwp_text_input_manager_v3_interface, 1);
|
||||
global->text_input =
|
||||
zwp_text_input_manager_v3_get_text_input (global->text_input_manager,
|
||||
gdk_wayland_seat_get_wl_seat (seat));
|
||||
global->serial = 0;
|
||||
zwp_text_input_v3_add_listener (global->text_input,
|
||||
&text_input_listener, global);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
registry_handle_global_remove (void *data,
|
||||
struct wl_registry *registry,
|
||||
uint32_t id)
|
||||
{
|
||||
GtkIMContextWaylandGlobal *global = data;
|
||||
|
||||
if (id != global->text_input_manager_wl_id)
|
||||
return;
|
||||
|
||||
g_clear_pointer (&global->text_input, zwp_text_input_v3_destroy);
|
||||
g_clear_pointer (&global->text_input_manager, zwp_text_input_manager_v3_destroy);
|
||||
}
|
||||
|
||||
static const struct wl_registry_listener registry_listener = {
|
||||
registry_handle_global,
|
||||
registry_handle_global_remove
|
||||
};
|
||||
|
||||
static void
|
||||
gtk_im_context_wayland_global_init (GdkDisplay *display)
|
||||
{
|
||||
g_return_if_fail (global == NULL);
|
||||
|
||||
global = g_new0 (GtkIMContextWaylandGlobal, 1);
|
||||
global->display = gdk_wayland_display_get_wl_display (display);
|
||||
global->registry = wl_display_get_registry (global->display);
|
||||
|
||||
wl_registry_add_listener (global->registry, ®istry_listener, global);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_im_context_wayland_focus_in (GtkIMContext *context)
|
||||
{
|
||||
GtkIMContextWayland *context_wayland = GTK_IM_CONTEXT_WAYLAND (context);
|
||||
|
||||
if (global->current == context)
|
||||
return;
|
||||
if (!global->text_input)
|
||||
return;
|
||||
|
||||
global->current = context;
|
||||
|
||||
if (global->focused)
|
||||
enable (context_wayland);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_im_context_wayland_focus_out (GtkIMContext *context)
|
||||
{
|
||||
GtkIMContextWayland *context_wayland = GTK_IM_CONTEXT_WAYLAND (context);
|
||||
|
||||
if (global->current != context)
|
||||
return;
|
||||
|
||||
if (global->focused)
|
||||
disable (context_wayland);
|
||||
|
||||
global->current = NULL;
|
||||
}
|
||||
|
||||
@@ -14,14 +14,14 @@ main (gint argc,
|
||||
box = gtk_grid_new ();
|
||||
gtk_container_add (GTK_CONTAINER (window), box);
|
||||
|
||||
widget = gtk_label_new ("Some filler text to avoid\nresizing of the window");
|
||||
widget = gtk_label_new ("Some filler text just to avoid\nresizing of the window");
|
||||
gtk_widget_set_margin_top (widget, 10);
|
||||
gtk_widget_set_margin_bottom (widget, 10);
|
||||
gtk_widget_set_margin_start (widget, 10);
|
||||
gtk_widget_set_margin_end (widget, 10);
|
||||
gtk_grid_attach (GTK_GRID (box), widget, 1, 1, 1, 1);
|
||||
|
||||
widget = gtk_label_new ("Some filler text to avoid\nresizing of the window");
|
||||
widget = gtk_label_new ("Some filler text just to avoid\nresizing of the window");
|
||||
gtk_widget_set_margin_top (widget, 10);
|
||||
gtk_widget_set_margin_bottom (widget, 10);
|
||||
gtk_widget_set_margin_start (widget, 10);
|
||||
|
||||
@@ -622,6 +622,54 @@ G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
dump_atk_table_cell (AtkTableCell *table_cell,
|
||||
guint depth,
|
||||
GString *string)
|
||||
{
|
||||
gint i;
|
||||
AtkObject *obj;
|
||||
GPtrArray *cells;
|
||||
gint row = -1, column = -1;
|
||||
|
||||
g_string_append_printf (string, "%*s<AtkTableCell>\n", depth, "");
|
||||
|
||||
obj = atk_table_cell_get_table (table_cell);
|
||||
if (obj)
|
||||
g_string_append_printf (string, "%*stable: %s\n", depth, "", get_name (obj));
|
||||
|
||||
cells = atk_table_cell_get_column_header_cells (table_cell);
|
||||
if (cells)
|
||||
{
|
||||
for (i = 0; i < cells->len; i++)
|
||||
{
|
||||
obj = g_ptr_array_index (cells, i);
|
||||
if (obj)
|
||||
g_string_append_printf (string, "%*scolumn-header[%d]: %s\n", depth, "", i, get_name (obj));
|
||||
}
|
||||
g_ptr_array_free (cells, TRUE);
|
||||
}
|
||||
|
||||
cells = atk_table_cell_get_row_header_cells (table_cell);
|
||||
if (cells)
|
||||
{
|
||||
for (i = 0; i < cells->len; i++)
|
||||
{
|
||||
obj = g_ptr_array_index (cells, i);
|
||||
if (obj)
|
||||
g_string_append_printf (string, "%*srow-header[%d]: %s\n", depth, "", i, get_name (obj));
|
||||
}
|
||||
g_ptr_array_free (cells, TRUE);
|
||||
}
|
||||
|
||||
g_string_append_printf (string, "%*scolumn-span: %d\n", depth, "", atk_table_cell_get_column_span (table_cell));
|
||||
g_string_append_printf (string, "%*srow-span: %d\n", depth, "", atk_table_cell_get_row_span (table_cell));
|
||||
if (atk_table_cell_get_position (table_cell, &row, &column))
|
||||
{
|
||||
g_string_append_printf (string, "%*sposition: %d %d\n", depth, "", row, column);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
dump_accessible (AtkObject *accessible,
|
||||
guint depth,
|
||||
@@ -675,6 +723,9 @@ dump_accessible (AtkObject *accessible,
|
||||
if (ATK_IS_TABLE (accessible))
|
||||
dump_atk_table (ATK_TABLE (accessible), depth, string);
|
||||
|
||||
if (ATK_IS_TABLE_CELL (accessible))
|
||||
dump_atk_table_cell (ATK_TABLE_CELL (accessible), depth, string);
|
||||
|
||||
for (i = 0; i < atk_object_get_n_accessible_children (accessible); i++)
|
||||
{
|
||||
AtkObject *child = atk_object_ref_accessible_child (accessible, i);
|
||||
|
||||
@@ -59,6 +59,11 @@ window1
|
||||
action 1 description: Creates a widget in which the contents of the cell can be edited
|
||||
action 2 name: activate
|
||||
action 2 description: Activates the cell
|
||||
<AtkTableCell>
|
||||
table: tv
|
||||
column-header[0]: unnamed-GtkButtonAccessible-0
|
||||
column-span: 1
|
||||
row-span: 1
|
||||
tv
|
||||
"table cell"
|
||||
parent: tv
|
||||
@@ -103,6 +108,11 @@ window1
|
||||
action 1 description: Creates a widget in which the contents of the cell can be edited
|
||||
action 2 name: activate
|
||||
action 2 description: Activates the cell
|
||||
<AtkTableCell>
|
||||
table: tv
|
||||
column-header[0]: unnamed-GtkButtonAccessible-0
|
||||
column-span: 1
|
||||
row-span: 1
|
||||
tv
|
||||
"table cell"
|
||||
parent: tv
|
||||
@@ -147,6 +157,11 @@ window1
|
||||
action 1 description: Creates a widget in which the contents of the cell can be edited
|
||||
action 2 name: activate
|
||||
action 2 description: Activates the cell
|
||||
<AtkTableCell>
|
||||
table: tv
|
||||
column-header[0]: unnamed-GtkButtonAccessible-0
|
||||
column-span: 1
|
||||
row-span: 1
|
||||
tv
|
||||
"table cell"
|
||||
parent: tv
|
||||
@@ -162,6 +177,12 @@ window1
|
||||
action 1 description: Creates a widget in which the contents of the cell can be edited
|
||||
action 2 name: activate
|
||||
action 2 description: Activates the cell
|
||||
<AtkTableCell>
|
||||
table: tv
|
||||
column-header[0]: unnamed-GtkButtonAccessible-0
|
||||
column-span: 1
|
||||
row-span: 1
|
||||
position: 1 0
|
||||
tv
|
||||
"table cell"
|
||||
parent: tv
|
||||
@@ -206,6 +227,12 @@ window1
|
||||
action 1 description: Creates a widget in which the contents of the cell can be edited
|
||||
action 2 name: activate
|
||||
action 2 description: Activates the cell
|
||||
<AtkTableCell>
|
||||
table: tv
|
||||
column-header[0]: unnamed-GtkButtonAccessible-0
|
||||
column-span: 1
|
||||
row-span: 1
|
||||
position: 1 0
|
||||
tv
|
||||
"table cell"
|
||||
parent: tv
|
||||
@@ -250,6 +277,12 @@ window1
|
||||
action 1 description: Creates a widget in which the contents of the cell can be edited
|
||||
action 2 name: activate
|
||||
action 2 description: Activates the cell
|
||||
<AtkTableCell>
|
||||
table: tv
|
||||
column-header[0]: unnamed-GtkButtonAccessible-0
|
||||
column-span: 1
|
||||
row-span: 1
|
||||
position: 1 0
|
||||
tv
|
||||
"table cell"
|
||||
parent: tv
|
||||
@@ -265,6 +298,12 @@ window1
|
||||
action 1 description: Creates a widget in which the contents of the cell can be edited
|
||||
action 2 name: activate
|
||||
action 2 description: Activates the cell
|
||||
<AtkTableCell>
|
||||
table: tv
|
||||
column-header[0]: unnamed-GtkButtonAccessible-0
|
||||
column-span: 1
|
||||
row-span: 1
|
||||
position: 2 0
|
||||
tv
|
||||
"table cell"
|
||||
parent: tv
|
||||
@@ -309,6 +348,12 @@ window1
|
||||
action 1 description: Creates a widget in which the contents of the cell can be edited
|
||||
action 2 name: activate
|
||||
action 2 description: Activates the cell
|
||||
<AtkTableCell>
|
||||
table: tv
|
||||
column-header[0]: unnamed-GtkButtonAccessible-0
|
||||
column-span: 1
|
||||
row-span: 1
|
||||
position: 2 0
|
||||
tv
|
||||
"table cell"
|
||||
parent: tv
|
||||
@@ -353,3 +398,9 @@ window1
|
||||
action 1 description: Creates a widget in which the contents of the cell can be edited
|
||||
action 2 name: activate
|
||||
action 2 description: Activates the cell
|
||||
<AtkTableCell>
|
||||
table: tv
|
||||
column-header[0]: unnamed-GtkButtonAccessible-0
|
||||
column-span: 1
|
||||
row-span: 1
|
||||
position: 2 0
|
||||
|
||||
Reference in New Issue
Block a user