Compare commits

..

1 Commits

Author SHA1 Message Date
Daniel Boles 5cc7ce0ef0 Expander: Fix parent map caused input to collapsed
…child, because we were not calling update_child_mapped(), so the hidden
child still floated in the aether silently waiting to wrongly take input

Close https://gitlab.gnome.org/GNOME/gtk/-/issues/2069
2023-04-29 21:58:00 +01:00
132 changed files with 35244 additions and 54068 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ pacman --noconfirm -Suy
pacman --noconfirm -S --needed \
mingw-w64-$MSYS2_ARCH-toolchain \
mingw-w64-$MSYS2_ARCH-ccache \
mingw-w64-$MSYS2_ARCH-pkgconf \
mingw-w64-$MSYS2_ARCH-pkg-config \
mingw-w64-$MSYS2_ARCH-gobject-introspection \
mingw-w64-$MSYS2_ARCH-adwaita-icon-theme \
mingw-w64-$MSYS2_ARCH-atk \
+1 -183
View File
@@ -1,188 +1,6 @@
Overview of Changes in GTK+ 3.24.42, 15-05-2024
Overview of Changes in GTK+ 3.24.38, xx-xx-xxxx
===============================================
* GtkFileChooser:
- Avoid warnings about floating refs
- Improve performance of recursive search
- Populate search model in an idle
* GtkGLArea:
- Fix a regression in transparency handling
* Printing:
- Avoid accessing freed printers
* Accessibility:
- Drop support for the deprecated atk_focus_tracker
* Wayland:
- Fix monitor sizes
- Fix a crash related to tablet removal
- Infer resizable edges for tiled windows
- Always commit soon after acking a configure
* Windows:
- Avoid committing NULL strings to IME
* gdk:
- Use css cursor names as far as possible
- Sync DND cursor use with GTK4
* macOs:
- Fix cocoa pasteboard constants
* build:
- Allow building against sysprof-capture-4
* Translation updates:
Georgian
Hebrew
Kabyle
Persian
Overview of Changes in GTK+ 3.24.41, 23-01-2024
===============================================
* Fix a crash introduced in the X11 changes in 3.24.40
* Build fixes
* Wayland: Fix interpretation of gtk-shell protocol
Overview of Changes in GTK+ 3.24.40, 17-01-2024
===============================================
* GtkEmojiChooser:
- Update to CLDR v44
- Add more translations
* GtkGestures:
- Preserve accuracy when translating events
* X11
- Support 'virtual' XRANDR monitors
* MacOs:
- Use consistent event coordinates
* Translation updates:
Georgian
Hebrew
Swedish
Overview of Changes in GTK+ 3.24.39, 19-12-2023
===============================================
* GtkMountOperation:
- Avoid a segfault
* GtkTooltip:
- Fix some positioning problems
* GtkFileChooser:
- Handle webdav in the pathbar
* GtkFileChooserNative:
- Fix closing portal file choosers
* GDK:
- Handle offscreen windows better in some places
* Wayland:
- Create pad devices on enter
- Ensure device-added/removed are emitted
- Make stylus button mappings compatible with X11
- Try harder to preserve cursor size with scaling
- Avoid oob access to cursor images
- Support tiling in xdg-shell
- Avoid using legacy cursor names
- Fix buffer size for scaled custom cursors
* X11:
- Remove slow path in gdk_cairo_draw_from_gl
- Trap more XRANDR errors
* MacOs:
- Make gdkquartz-cocoa-access.h usable again
- Silence secure-restore message
* Translation updates
Belarusian
British English
Catalan
Chinese (China)
Czech
Danish
Esperanto
Farsi
Georgian
Greek
Hebrew
Icelandic
Kazakh
Korean
Polish
Punjabi
Romanian
Slovak
Slovenian
Spanish
Turkish
Overview of Changes in GTK+ 3.24.38, 21-05-2023
===============================================
* GtkFileChooser:
- Avoid warnings with GLib 2.76
* Theme:
- Set caret color in the dark theme
* Windows:
- Fix running under GLES
* Wayland:
- Notify on initial setting changes
- Don't crash on 0 size cursors
- Don't crash if xdg_activation_v1 is missing
* Debugging:
- Show more information in the inspector
* Translation updates
Abkhazian
Basque
Brazilian Portuguese
Bulgarian
Catalan
Danish
Dutch
French
Galician
Georgian
German
Hebrew
Hungarian
Indonesian
ITalian
Korean
Lithuanian
Persian
Polish
Portuguese
Russian
Serbian
Slovenian
Spanish
Swedish
Turkish
Ukrainian
Overview of Changes in GTK+ 3.24.37, 02-03-2023
===============================================
-1
View File
@@ -24,7 +24,6 @@ gdk__private__ (void)
gdk_profiler_start,
gdk_profiler_stop,
gdk_window_titlebar_gesture,
gdk_window_is_impl_offscreen,
};
return &table;
-4
View File
@@ -31,8 +31,6 @@ gboolean gdk_display_get_debug_updates (GdkDisplay *display);
void gdk_display_set_debug_updates (GdkDisplay *display,
gboolean debug_updates);
gboolean gdk_window_is_impl_offscreen (GdkWindow *window);
const gchar * gdk_get_desktop_startup_id (void);
const gchar * gdk_get_desktop_autostart_id (void);
@@ -71,8 +69,6 @@ typedef struct {
gboolean (* gdk_window_titlebar_gesture) (GdkWindow *window,
GdkTitlebarGesture gesture);
gboolean (* gdk_window_is_impl_offscreen) (GdkWindow *window);
} GdkPrivateVTable;
GDK_AVAILABLE_IN_ALL
-3
View File
@@ -2710,9 +2710,6 @@ gdk_display_get_monitor_at_window (GdkDisplay *display,
g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL);
if (window && gdk_window_is_impl_offscreen (window))
window = gdk_offscreen_window_get_embedder (window);
class = GDK_DISPLAY_GET_CLASS (display);
if (class->get_monitor_at_window)
{
+4 -4
View File
@@ -36,12 +36,12 @@ static struct {
const gchar *name;
GdkCursor *cursor;
} drag_cursors[] = {
{ GDK_ACTION_DEFAULT, NULL, NULL },
{ GDK_ACTION_ASK, "dnd-ask", NULL },
{ GDK_ACTION_COPY, "copy", NULL },
{ GDK_ACTION_DEFAULT, NULL, NULL },
{ GDK_ACTION_ASK, "dnd-ask", NULL },
{ GDK_ACTION_COPY, "dnd-copy", NULL },
{ GDK_ACTION_MOVE, "dnd-move", NULL },
{ GDK_ACTION_LINK, "dnd-link", NULL },
{ 0, "default", NULL },
{ 0, "dnd-none", NULL },
};
enum {
+19 -16
View File
@@ -22,6 +22,10 @@
#include "gdkinternals.h"
#ifdef GDK_WINDOWING_WIN32
# include "win32/gdkwin32.h"
#endif
#include <epoxy/gl.h>
#include <math.h>
#include <string.h>
@@ -337,7 +341,7 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
int width,
int height)
{
GdkGLContext *paint_context, *current_context;
GdkGLContext *paint_context;
cairo_surface_t *image;
cairo_matrix_t matrix;
int dx, dy, window_scale;
@@ -348,7 +352,7 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
int alpha_size = 0;
cairo_region_t *clip_region;
GdkGLContextPaintData *paint_data;
GLsync sync;
GLsync sync = NULL;
impl_window = window->impl_window;
@@ -362,13 +366,9 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
}
clip_region = gdk_cairo_region_from_clip (cr);
current_context = gdk_gl_context_get_current ();
if ((current_context != NULL) && (current_context != paint_context) &&
gdk_gl_context_has_sync (current_context))
if ((gdk_gl_context_get_current () != NULL) && (gdk_gl_context_get_current () != paint_context))
sync = glFenceSync (GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
else
sync = NULL;
gdk_gl_context_make_current (paint_context);
@@ -393,10 +393,10 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
{
glBindTexture (GL_TEXTURE_2D, source);
if (gdk_gl_context_has_tex_param (paint_context))
glGetTexLevelParameteriv (GL_TEXTURE_2D, 0, GL_TEXTURE_ALPHA_SIZE, &alpha_size);
else
if (gdk_gl_context_get_use_es (paint_context))
alpha_size = 1;
else
glGetTexLevelParameteriv (GL_TEXTURE_2D, 0, GL_TEXTURE_ALPHA_SIZE, &alpha_size);
}
else
{
@@ -566,8 +566,7 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
glBindTexture (GL_TEXTURE_2D, source);
if (gdk_gl_context_get_use_es (paint_context) ||
!gdk_gl_context_has_tex_param (paint_context))
if (gdk_gl_context_get_use_es (paint_context))
{
texture_width = width;
texture_height = height;
@@ -658,6 +657,13 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
{
/* Software fallback */
int major, minor, version;
gboolean es_read_bgra = FALSE;
#ifdef GDK_WINDOWING_WIN32
/* on ANGLE GLES, we need to set the glReadPixel() format as GL_BGRA instead */
if (GDK_WIN32_IS_GL_CONTEXT(paint_context))
es_read_bgra = TRUE;
#endif
gdk_gl_context_get_version (paint_context, &major, &minor);
version = major * 100 + minor;
@@ -699,11 +705,8 @@ gdk_cairo_draw_from_gl (cairo_t *cr,
if (!gdk_gl_context_get_use_es (paint_context))
glReadPixels (x, y, width, height, GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV,
cairo_image_surface_get_data (image));
else if (gdk_gl_context_has_texture_format_bgra (paint_context) && G_BYTE_ORDER == G_LITTLE_ENDIAN)
glReadPixels (x, y, width, height, GL_BGRA, GL_UNSIGNED_BYTE,
cairo_image_surface_get_data (image));
else
glReadPixels (x, y, width, height, GL_RGBA, GL_UNSIGNED_BYTE,
glReadPixels (x, y, width, height, es_read_bgra ? GL_BGRA : GL_RGBA, GL_UNSIGNED_BYTE,
cairo_image_surface_get_data (image));
glPixelStorei (GL_PACK_ROW_LENGTH, 0);
-35
View File
@@ -101,13 +101,10 @@ typedef struct {
guint has_gl_framebuffer_blit : 1;
guint has_frame_terminator : 1;
guint has_unpack_subimage : 1;
guint has_sync : 1;
guint has_texture_format_bgra : 1;
guint extensions_checked : 1;
guint debug_enabled : 1;
guint forward_compatible : 1;
guint is_legacy : 1;
guint has_tex_param : 1;
int use_es;
@@ -436,14 +433,6 @@ gdk_gl_context_has_frame_terminator (GdkGLContext *context)
return priv->has_frame_terminator;
}
gboolean
gdk_gl_context_has_tex_param (GdkGLContext *context)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
return priv->has_tex_param;
}
gboolean
gdk_gl_context_has_unpack_subimage (GdkGLContext *context)
{
@@ -452,22 +441,6 @@ gdk_gl_context_has_unpack_subimage (GdkGLContext *context)
return priv->has_unpack_subimage;
}
gboolean
gdk_gl_context_has_sync (GdkGLContext *context)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
return priv->has_sync;
}
gboolean
gdk_gl_context_has_texture_format_bgra (GdkGLContext *context)
{
GdkGLContextPrivate *priv = gdk_gl_context_get_instance_private (context);
return priv->has_texture_format_bgra;
}
/**
* gdk_gl_context_set_debug_enabled:
* @context: a #GdkGLContext
@@ -836,9 +809,6 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
priv->has_frame_terminator = FALSE;
priv->has_unpack_subimage = epoxy_has_gl_extension ("GL_EXT_unpack_subimage");
priv->has_sync = priv->gl_version >= 30;
priv->has_texture_format_bgra = epoxy_has_gl_extension ("GL_EXT_texture_format_BGRA8888");
priv->has_tex_param = priv->gl_version >= 31;
}
else
{
@@ -848,11 +818,6 @@ gdk_gl_context_check_extensions (GdkGLContext *context)
priv->has_gl_framebuffer_blit = priv->gl_version >= 30 || epoxy_has_gl_extension ("GL_EXT_framebuffer_blit");
priv->has_frame_terminator = epoxy_has_gl_extension ("GL_GREMEDY_frame_terminator");
priv->has_unpack_subimage = TRUE;
priv->has_tex_param = priv->gl_version >= 10 &&
epoxy_is_desktop_gl ();
priv->has_sync = priv->gl_version >= 32 ||
epoxy_has_gl_extension ("GL_ARB_sync") ||
epoxy_has_gl_extension ("GL_APPLE_sync");
/* We asked for a core profile, but we didn't get one, so we're in legacy mode */
if (priv->gl_version < 32)
-3
View File
@@ -85,10 +85,7 @@ GdkGLContextPaintData * gdk_gl_context_get_paint_data (GdkGLContext
gboolean gdk_gl_context_use_texture_rectangle (GdkGLContext *context);
gboolean gdk_gl_context_has_framebuffer_blit (GdkGLContext *context);
gboolean gdk_gl_context_has_frame_terminator (GdkGLContext *context);
gboolean gdk_gl_context_has_tex_param (GdkGLContext *context);
gboolean gdk_gl_context_has_unpack_subimage (GdkGLContext *context);
gboolean gdk_gl_context_has_sync (GdkGLContext *context);
gboolean gdk_gl_context_has_texture_format_bgra (GdkGLContext *context);
void gdk_gl_context_end_frame (GdkGLContext *context,
cairo_region_t *painted,
cairo_region_t *damage);
-9
View File
@@ -780,12 +780,3 @@ gdk_offscreen_window_class_init (GdkOffscreenWindowClass *klass)
impl_class->delete_property = NULL;
impl_class->get_scale_factor = gdk_offscreen_window_get_scale_factor;
}
gboolean
gdk_window_is_impl_offscreen (GdkWindow *window)
{
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
return GDK_IS_OFFSCREEN_WINDOW (window->impl);
}
-6
View File
@@ -10542,12 +10542,6 @@ void
gdk_window_set_transient_for (GdkWindow *window,
GdkWindow *parent)
{
if (parent != NULL &&
GDK_WINDOW_IMPL_GET_CLASS (window->impl) != GDK_WINDOW_IMPL_GET_CLASS (parent->impl))
{
return;
}
window->transient_for = parent;
GDK_WINDOW_IMPL_GET_CLASS (window->impl)->set_transient_for (window, parent);
+1 -1
View File
@@ -166,7 +166,7 @@ maybe_flip_position (gint bounds_pos,
*flipped = TRUE;
secondary = rect_pos + (1 - rect_sign) * rect_size / 2 - offset - (1 - window_sign) * window_size / 2;
if ((secondary >= bounds_pos && secondary + window_size <= bounds_pos + bounds_size) || primary > bounds_pos + bounds_size)
if (secondary >= bounds_pos && secondary + window_size <= bounds_pos + bounds_size)
return secondary;
*flipped = FALSE;
+1 -4
View File
@@ -245,10 +245,7 @@
window->height = content_rect.size.height;
if(window->width % align)
{
window->width += align - window->width % align;
content_rect.size.width = window->width;
}
content_rect.size.width += align - window->width % align;
content_rect.origin.x = 0;
content_rect.origin.y = 0;
+1 -1
View File
@@ -508,7 +508,7 @@ copy_rectangle_argb32 (cairo_surface_t *dest, cairo_surface_t *source,
owner: self
userInfo: nil];
[self addTrackingArea: trackingArea];
trackingRect = (NSInteger)trackingArea;
trackingRect = (NSInteger)[trackingArea retain];
#else
trackingRect = [self addTrackingRect: rect
owner: self
+2
View File
@@ -130,6 +130,7 @@ gdk_quartz_display_frame_cb (gpointer data)
GdkQuartzDisplay *display_quartz = data;
GSList *iter, **last_next = NULL;
gint64 presentation_time;
gint64 now;
source = (GdkDisplayLinkSource *)display_quartz->frame_source;
@@ -143,6 +144,7 @@ gdk_quartz_display_frame_cb (gpointer data)
}
presentation_time = source->presentation_time;
now = g_source_get_time (display_quartz->frame_source);
for (; iter != NULL; iter = iter->next)
{
+21 -17
View File
@@ -417,13 +417,12 @@ get_toplevel_from_ns_event (NSEvent *nsevent,
gint *y)
{
GdkWindow *toplevel = NULL;
NSWindow* nswindow = [nsevent window];
if (nswindow)
if ([nsevent window])
{
GdkQuartzView *view;
NSPoint point, view_point;
NSRect view_bounds;
NSRect view_frame;
view = (GdkQuartzView *)[[nsevent window] contentView];
@@ -431,7 +430,7 @@ get_toplevel_from_ns_event (NSEvent *nsevent,
point = [nsevent locationInWindow];
view_point = [view convertPoint:point fromView:nil];
view_bounds = [view bounds];
view_frame = [view frame];
/* NSEvents come in with a window set, but with window coordinates
* out of window bounds. For e.g. moved events this is fine, we use
@@ -446,10 +445,10 @@ get_toplevel_from_ns_event (NSEvent *nsevent,
* toplevel window below.
*/
if (is_mouse_button_press_event ([nsevent type]) &&
(view_point.x < view_bounds.origin.x ||
view_point.x >= view_bounds.origin.x + view_bounds.size.width ||
view_point.y < view_bounds.origin.y ||
view_point.y >= view_bounds.origin.y + view_bounds.size.height))
(view_point.x < view_frame.origin.x ||
view_point.x >= view_frame.origin.x + view_frame.size.width ||
view_point.y < view_frame.origin.y ||
view_point.y >= view_frame.origin.y + view_frame.size.height))
{
toplevel = NULL;
@@ -469,22 +468,27 @@ get_toplevel_from_ns_event (NSEvent *nsevent,
* fallback path, which could match the window that is
* directly under the titlebar.
*/
if (view_point.y > view_bounds.origin.y + view_bounds.size.height &&
view_point.x >= view_bounds.origin.x &&
view_point.x < view_bounds.origin.x + view_bounds.size.width)
if (view_point.y < 0 &&
view_point.x >= view_frame.origin.x &&
view_point.x < view_frame.origin.x + view_frame.size.width)
{
NSRect window_frame = [view convertRect: [nswindow frame]
fromView: nil];
if (view_point.y <=
view_bounds.origin.y + window_frame.size.height)
NSView *superview = [view superview];
if (superview)
{
return NULL;
NSRect superview_frame = [superview frame];
int titlebar_height = superview_frame.size.height -
view_frame.size.height;
if (titlebar_height > 0 && view_point.y >= -titlebar_height)
{
return NULL;
}
}
}
}
else
{
*screen_point = [(GdkQuartzNSWindow*)nswindow convertPointToScreen:point];
*screen_point = [(GdkQuartzNSWindow*)[nsevent window] convertPointToScreen:point];
*x = point.x;
*y = toplevel->height - point.y;
}
+1
View File
@@ -25,6 +25,7 @@
#include <AppKit/AppKit.h>
#include <gdk/gdk.h>
#include "gdkquartz.h"
GDK_AVAILABLE_IN_ALL
NSEvent *gdk_quartz_event_get_nsevent (GdkEvent *event);
-14
View File
@@ -27,20 +27,6 @@
#include <gdk/gdk.h>
#include <gdk/quartz/gdkquartz.h>
#if MAC_OS_X_VERSION_MIN_REQUIRED < 101400
#define GDK_QUARTZ_FILE_PBOARD_TYPE NSURLPboardType
#define GDK_QUARTZ_URL_PBOARD_TYPE NSURLPboardType
#define GDK_QUARTZ_COLOR_PBOARD_TYPE NSColorPboardType
#define GDK_QUARTZ_STRING_PBOARD_TYPE NSStringPboardType
#define GDK_QUARTZ_TIFF_PBOARD_TYPE NSTIFFPboardType
#else
#define GDK_QUARTZ_FILE_PBOARD_TYPE NSPasteboardTypeFileURL
#define GDK_QUARTZ_URL_PBOARD_TYPE NSPasteboardTypeURL
#define GDK_QUARTZ_COLOR_PBOARD_TYPE NSPasteboardTypeColor
#define GDK_QUARTZ_STRING_PBOARD_TYPE NSPasteboardTypeString
#define GDK_QUARTZ_TIFF_PBOARD_TYPE NSPasteboardTypeTIFF
#endif
/* Drag and Drop/Clipboard */
GDK_AVAILABLE_IN_ALL
GdkAtom gdk_quartz_pasteboard_type_to_atom_libgtk_only (NSString *type);
+18 -2
View File
@@ -174,6 +174,19 @@ _gdk_quartz_display_text_property_to_utf8_list (GdkDisplay *display,
}
}
#if MAC_OS_X_VERSION_MIN_REQUIRED < 101400
#define GDK_QUARTZ_URL_PBOARD_TYPE NSURLPboardType
#define GDK_QUARTZ_COLOR_PBOARD_TYPE NSColorPboardType
#define GDK_QUARTZ_STRING_PBOARD_TYPE NSStringPboardType
#define GDK_QUARTZ_TIFF_PBOARD_TYPE NSTIFFPboardType
#else
#define GDK_QUARTZ_FILE_PBOARD_TYPE NSPasteboardTypeFileURL
#define GDK_QUARTZ_URL_PBOARD_TYPE NSPasteboardTypeURL
#define GDK_QUARTZ_COLOR_PBOARD_TYPE NSPasteboardTypeColor
#define GDK_QUARTZ_STRING_PBOARD_TYPE NSPasteboardTypeString
#define GDK_QUARTZ_TIFF_PBOARD_TYPE NSPasteboardTypeTIFF
#endif
GdkAtom
gdk_quartz_pasteboard_type_to_atom_libgtk_only (NSString *type)
{
@@ -183,9 +196,12 @@ gdk_quartz_pasteboard_type_to_atom_libgtk_only (NSString *type)
return gdk_atom_intern_static_string ("image/tiff");
else if ([type isEqualToString:GDK_QUARTZ_COLOR_PBOARD_TYPE])
return gdk_atom_intern_static_string ("application/x-color");
else if ([type isEqualToString:GDK_QUARTZ_URL_PBOARD_TYPE] ||
[type isEqualToString:GDK_QUARTZ_FILE_PBOARD_TYPE])
else if ([type isEqualToString:GDK_QUARTZ_URL_PBOARD_TYPE])
return gdk_atom_intern_static_string ("text/uri-list");
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
else if ([type isEqualToString:GDK_QUARTZ_FILE_PBOARD_TYPE])
return gdk_atom_intern_static_string ("text/uri-list");
#endif
else
return gdk_atom_intern ([type UTF8String], FALSE);
}
-4
View File
@@ -2389,10 +2389,6 @@ gdk_quartz_window_set_type_hint (GdkWindow *window,
if (!impl)
return;
if (hint == GDK_WINDOW_TYPE_HINT_NORMAL &&
window->window_type == GDK_WINDOW_TEMP)
hint = GDK_WINDOW_TYPE_HINT_POPUP_MENU;
impl->type_hint = hint;
/* Match the documentation, only do something if we're not mapped yet. */
+13 -54
View File
@@ -101,7 +101,6 @@ static const struct {
{ "move", "dnd-move" },
{ "no-drop", "dnd-none" },
{ "dnd-ask", "dnd-copy" }, /* not CSS, but we want to guarantee it anyway */
{ "dnd-move", "default" },
{ "not-allowed", "crossed_circle" },
{ "grab", "hand2" },
{ "grabbing", "hand2" },
@@ -162,7 +161,7 @@ _gdk_wayland_cursor_update (GdkWaylandDisplay *display_wayland,
{
c = wl_cursor_theme_get_cursor (theme, name_fallback (cursor->name));
if (!c)
c = wl_cursor_theme_get_cursor (theme, "default");
c = wl_cursor_theme_get_cursor (theme, "left_ptr");
}
}
@@ -221,7 +220,7 @@ _gdk_wayland_cursor_get_buffer (GdkCursor *cursor,
{
GdkWaylandCursor *wayland_cursor = GDK_WAYLAND_CURSOR (cursor);
if (wayland_cursor->wl_cursor && wayland_cursor->wl_cursor->image_count > 0)
if (wayland_cursor->wl_cursor)
{
struct wl_cursor_image *image;
int cursor_scale;
@@ -237,13 +236,13 @@ _gdk_wayland_cursor_get_buffer (GdkCursor *cursor,
image = wayland_cursor->wl_cursor->images[image_index];
cursor_scale = wayland_cursor->scale;
while ((image->width % cursor_scale != 0) ||
(image->height % cursor_scale != 0))
if ((image->width % cursor_scale != 0) ||
(image->height % cursor_scale != 0))
{
g_warning_once (G_STRLOC " cursor image size (%dx%d) not an integer"
g_warning (G_STRLOC " cursor image size (%dx%d) not an integer"
"multiple of scale (%d)", image->width, image->height,
cursor_scale);
cursor_scale--;
cursor_scale = 1;
}
*hotspot_x = image->hotspot_x / cursor_scale;
@@ -351,7 +350,7 @@ _gdk_wayland_cursor_init (GdkWaylandCursor *cursor)
{
}
GdkCursor *
static GdkCursor *
_gdk_wayland_display_get_cursor_for_name_with_scale (GdkDisplay *display,
const gchar *name,
guint scale)
@@ -424,36 +423,6 @@ _gdk_wayland_display_get_cursor_for_type_with_scale (GdkDisplay *display,
g_free (cursor_name);
if (!result)
{
const char *name = NULL;
/* Map cursors back to standard names.
* Currently, we just list the cursor values
* that are used in GTK. More can be added.
*/
switch ((int)cursor_type)
{
case GDK_XTERM:
name = "text";
break;
case GDK_FLEUR:
name = "move";
break;
case GDK_CROSSHAIR:
name = "cross";
break;
default:
name = "default";
break;
}
if (name)
result = _gdk_wayland_display_get_cursor_for_name_with_scale (display,
name,
scale);
}
return result;
}
@@ -498,24 +467,15 @@ _gdk_wayland_display_get_cursor_for_surface (GdkDisplay *display,
cursor->surface.hotspot_x = x;
cursor->surface.hotspot_y = y;
cursor->surface.scale = 1;
if (surface)
{
cursor->surface.width = cairo_image_surface_get_width (surface);
cursor->surface.height = cairo_image_surface_get_height (surface);
double sx, sy;
cairo_surface_get_device_scale (surface, &sx, &sy);
cursor->surface.scale = (int)sx;
while ((cursor->surface.width % cursor->surface.scale != 0) ||
(cursor->surface.height % cursor->surface.scale != 0))
{
g_warning_once (G_STRLOC " cursor image size (%dx%d) not an integer"
"multiple of scale (%d)", cursor->surface.width, cursor->surface.height,
cursor->surface.scale);
cursor->surface.scale--;
}
cursor->surface.width = cairo_image_surface_get_width (surface);
cursor->surface.height = cairo_image_surface_get_height (surface);
cursor->surface.hotspot_x *= sx;
cursor->surface.hotspot_y *= sx;
}
@@ -523,13 +483,12 @@ _gdk_wayland_display_get_cursor_for_surface (GdkDisplay *display,
{
cursor->surface.width = 1;
cursor->surface.height = 1;
cursor->surface.scale = 1;
}
cursor->surface.cairo_surface =
_gdk_wayland_display_create_shm_surface (display_wayland,
cursor->surface.width / cursor->surface.scale,
cursor->surface.height / cursor->surface.scale,
cursor->surface.width,
cursor->surface.height,
cursor->surface.scale);
buffer = _gdk_wayland_shm_surface_get_wl_buffer (cursor->surface.cairo_surface);
+29 -102
View File
@@ -524,8 +524,8 @@ gdk_wayland_device_set_window_cursor (GdkDevice *device,
{
guint scale = pointer->current_output_scale;
cursor =
_gdk_wayland_display_get_cursor_for_name_with_scale (seat->display,
"default",
_gdk_wayland_display_get_cursor_for_type_with_scale (seat->display,
GDK_LEFT_PTR,
scale);
}
else
@@ -2921,17 +2921,13 @@ _gdk_wayland_seat_remove_tablet_pad (GdkWaylandSeat *seat,
seat->tablet_pads = g_list_remove (seat->tablet_pads, pad);
if (pad->device)
{
device_manager->devices =
g_list_remove (device_manager->devices, pad->device);
g_signal_emit_by_name (device_manager, "device-removed", pad->device);
device_manager->devices =
g_list_remove (device_manager->devices, pad->device);
g_signal_emit_by_name (device_manager, "device-removed", pad->device);
_gdk_device_set_associated_device (pad->device, NULL);
g_object_unref (pad->device);
}
_gdk_device_set_associated_device (pad->device, NULL);
g_object_unref (pad->device);
g_free (pad);
}
@@ -3963,9 +3959,9 @@ tablet_tool_handle_button (void *data,
tablet->pointer_info.press_serial = serial;
if (button == BTN_STYLUS)
n_button = GDK_BUTTON_MIDDLE;
else if (button == BTN_STYLUS2)
n_button = GDK_BUTTON_SECONDARY;
else if (button == BTN_STYLUS2)
n_button = GDK_BUTTON_MIDDLE;
else if (button == BTN_STYLUS3)
n_button = 8; /* Back */
else
@@ -4443,8 +4439,27 @@ static void
tablet_pad_handle_done (void *data,
struct zwp_tablet_pad_v2 *wp_tablet_pad)
{
GdkWaylandTabletPadData *pad = data;
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
GdkWaylandDeviceManager *device_manager =
GDK_WAYLAND_DEVICE_MANAGER (seat->device_manager);
GDK_NOTE (EVENTS,
g_message ("tablet pad handle done, pad = %p", wp_tablet_pad));
pad->device =
g_object_new (GDK_TYPE_WAYLAND_DEVICE_PAD,
"name", "Pad device",
"type", GDK_DEVICE_TYPE_SLAVE,
"input-source", GDK_SOURCE_TABLET_PAD,
"input-mode", GDK_MODE_SCREEN,
"display", gdk_seat_get_display (pad->seat),
"device-manager", device_manager,
"seat", seat,
NULL);
_gdk_device_set_associated_device (pad->device, seat->master_keyboard);
g_signal_emit_by_name (device_manager, "device-added", pad->device);
}
static void
@@ -4491,60 +4506,14 @@ tablet_pad_handle_enter (void *data,
{
GdkWaylandTabletPadData *pad = data;
GdkWaylandTabletData *tablet = zwp_tablet_v2_get_user_data (wp_tablet);
GdkWaylandSeat *seat = GDK_WAYLAND_SEAT (pad->seat);
GdkWaylandDeviceManager *device_manager =
GDK_WAYLAND_DEVICE_MANAGER (seat->device_manager);
GDK_NOTE (EVENTS,
g_message ("tablet pad handle enter, pad = %p, tablet = %p surface = %p",
wp_tablet_pad, wp_tablet, surface));
if (pad->device && pad->current_tablet != tablet)
{
device_manager->devices =
g_list_remove (device_manager->devices, pad->device);
g_signal_emit_by_name (device_manager, "device-removed", pad->device);
_gdk_device_set_associated_device (pad->device, NULL);
g_clear_object (&pad->device);
}
/* Relate pad and tablet */
tablet->pads = g_list_append (tablet->pads, pad);
tablet->pads = g_list_prepend (tablet->pads, pad);
pad->current_tablet = tablet;
if (!pad->device)
{
GdkWaylandTabletPadData *pad = data;
gchar *name, *vid, *pid;
name = g_strdup_printf ("%s Pad %d",
tablet->name,
g_list_index (tablet->pads, pad) + 1);
vid = g_strdup_printf ("%.4x", tablet->vid);
pid = g_strdup_printf ("%.4x", tablet->pid);
pad->device =
g_object_new (GDK_TYPE_WAYLAND_DEVICE_PAD,
"name", name,
"vendor-id", vid,
"product-id", pid,
"type", GDK_DEVICE_TYPE_SLAVE,
"input-source", GDK_SOURCE_TABLET_PAD,
"input-mode", GDK_MODE_SCREEN,
"display", gdk_seat_get_display (pad->seat),
"device-manager", device_manager,
"seat", seat,
NULL);
_gdk_device_set_associated_device (pad->device, seat->master_keyboard);
device_manager->devices =
g_list_prepend (device_manager->devices, pad->device);
g_signal_emit_by_name (device_manager, "device-added", pad->device);
g_free (name);
g_free (vid);
g_free (pid);
}
}
static void
@@ -5144,21 +5113,6 @@ gdk_wayland_seat_get_slaves (GdkSeat *seat,
}
}
/* There is no specific capability for pads, return
* them anyways if all devices are requested
*/
if (capabilities == GDK_SEAT_CAPABILITY_ALL)
{
GList *l;
for (l = wayland_seat->tablet_pads; l; l = l->next)
{
GdkWaylandTabletPadData *pad = l->data;
slaves = g_list_prepend (slaves, pad->device);
}
}
return slaves;
}
@@ -5199,22 +5153,6 @@ init_pointer_data (GdkWaylandPointerData *pointer_data,
master);
}
static void
device_manager_device_added (GdkDeviceManager *device_manager,
GdkDevice *device,
GdkSeat *seat)
{
g_signal_emit_by_name (seat, "device-added", device);
}
static void
device_manager_device_removed (GdkDeviceManager *device_manager,
GdkDevice *device,
GdkSeat *seat)
{
g_signal_emit_by_name (seat, "device-removed", device);
}
void
_gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager,
guint32 id,
@@ -5283,11 +5221,6 @@ _gdk_wayland_device_manager_add_seat (GdkDeviceManager *device_manager,
seat);
}
g_signal_connect (seat->device_manager, "device-added",
G_CALLBACK (device_manager_device_added), seat);
g_signal_connect (seat->device_manager, "device-removed",
G_CALLBACK (device_manager_device_removed), seat);
gdk_display_add_seat (display, GDK_SEAT (seat));
}
@@ -5307,12 +5240,6 @@ _gdk_wayland_device_manager_remove_seat (GdkDeviceManager *manager,
if (seat->id != id)
continue;
g_signal_handlers_disconnect_by_func (manager,
device_manager_device_added,
seat);
g_signal_handlers_disconnect_by_func (manager,
device_manager_device_removed,
seat);
gdk_display_remove_seat (display, GDK_SEAT (seat));
break;
}
+3 -10
View File
@@ -49,12 +49,6 @@
#include "xdg-foreign-unstable-v1-client-protocol.h"
#include "server-decoration-client-protocol.h"
#ifdef HAVE_TOPLEVEL_STATE_SUSPENDED
#define XDG_WM_BASE_VERSION 6
#else
#define XDG_WM_BASE_VERSION 2
#endif
/**
* SECTION:wayland_interaction
* @Short_description: Wayland backend-specific functions
@@ -416,7 +410,6 @@ gdk_registry_handle_global (void *data,
else if (strcmp (interface, "xdg_wm_base") == 0)
{
display_wayland->xdg_wm_base_id = id;
display_wayland->xdg_wm_base_version = version;
}
else if (strcmp (interface, "zxdg_shell_v6") == 0)
{
@@ -640,7 +633,6 @@ _gdk_wayland_display_open (const gchar *display_name)
}
process_on_globals_closures (display_wayland);
display_wayland->selection = gdk_wayland_selection_new ();
/* Wait for initializing to complete. This means waiting for all
* asynchrounous roundtrips that were triggered during initial roundtrip. */
@@ -659,8 +651,7 @@ _gdk_wayland_display_open (const gchar *display_name)
display_wayland->xdg_wm_base =
wl_registry_bind (display_wayland->wl_registry,
display_wayland->xdg_wm_base_id,
&xdg_wm_base_interface,
MIN (display_wayland->xdg_wm_base_version, XDG_WM_BASE_VERSION));
&xdg_wm_base_interface, 1);
xdg_wm_base_add_listener (display_wayland->xdg_wm_base,
&xdg_wm_base_listener,
display_wayland);
@@ -685,6 +676,8 @@ _gdk_wayland_display_open (const gchar *display_name)
return NULL;
}
display_wayland->selection = gdk_wayland_selection_new ();
g_signal_emit_by_name (display, "opened");
return display;
-1
View File
@@ -77,7 +77,6 @@ struct _GdkWaylandDisplay
guint32 serial;
uint32_t xdg_wm_base_id;
int xdg_wm_base_version;
uint32_t zxdg_shell_v6_id;
GdkWaylandShellVariant shell_variant;
+1 -1
View File
@@ -172,7 +172,7 @@ gdk_wayland_keymap_get_entries_for_keyval (GdkKeymap *keymap,
*n_keys = retval->len;
*keys = (GdkKeymapKey*) g_array_free (retval, FALSE);
return *n_keys > 0;
return TRUE;
}
static gboolean
+5 -4
View File
@@ -31,10 +31,11 @@ struct _GdkWaylandMonitor {
struct wl_output *output;
struct zxdg_output_v1 *xdg_output;
/* Raw wl_output data */
GdkRectangle output_geometry;
/* Raw xdg_output data */
GdkRectangle xdg_output_geometry;
/* Size and position, can be either from wl_output or xdg_output */
int32_t x;
int32_t y;
int32_t width;
int32_t height;
char *name;
gboolean wl_output_done;
gboolean xdg_output_done;
-3
View File
@@ -70,9 +70,6 @@ GdkCursor *_gdk_wayland_display_get_cursor_for_type_with_scale (GdkDisplay *d
guint scale);
GdkCursor *_gdk_wayland_display_get_cursor_for_name (GdkDisplay *display,
const gchar *name);
GdkCursor *_gdk_wayland_display_get_cursor_for_name_with_scale (GdkDisplay *display,
const gchar *name,
guint scale);
GdkCursor *_gdk_wayland_display_get_cursor_for_surface (GdkDisplay *display,
cairo_surface_t *surface,
gdouble x,
+43 -59
View File
@@ -336,7 +336,7 @@ struct _TranslationEntry {
static TranslationEntry * find_translation_entry_by_schema (const char *schema,
const char *key);
static void
update_xft_settings (GdkScreen *screen, gboolean notify)
update_xft_settings (GdkScreen *screen)
{
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (screen);
GSettings *settings;
@@ -471,29 +471,25 @@ update_xft_settings (GdkScreen *screen, gboolean notify)
if (screen_wayland->xft_settings.antialias != xft_settings.antialias)
{
screen_wayland->xft_settings.antialias = xft_settings.antialias;
if (notify)
notify_setting (screen, "gtk-xft-antialias");
notify_setting (screen, "gtk-xft-antialias");
}
if (screen_wayland->xft_settings.hinting != xft_settings.hinting)
{
screen_wayland->xft_settings.hinting = xft_settings.hinting;
if (notify)
notify_setting (screen, "gtk-xft-hinting");
notify_setting (screen, "gtk-xft-hinting");
}
if (screen_wayland->xft_settings.hintstyle != xft_settings.hintstyle)
{
screen_wayland->xft_settings.hintstyle = xft_settings.hintstyle;
if (notify)
notify_setting (screen, "gtk-xft-hintstyle");
notify_setting (screen, "gtk-xft-hintstyle");
}
if (screen_wayland->xft_settings.rgba != xft_settings.rgba)
{
screen_wayland->xft_settings.rgba = xft_settings.rgba;
if (notify)
notify_setting (screen, "gtk-xft-rgba");
notify_setting (screen, "gtk-xft-rgba");
}
if (screen_wayland->xft_settings.dpi != xft_settings.dpi)
@@ -514,8 +510,7 @@ update_xft_settings (GdkScreen *screen, gboolean notify)
_gdk_screen_set_resolution (screen, dpi);
if (notify)
notify_setting (screen, "gtk-xft-dpi");
notify_setting (screen, "gtk-xft-dpi");
}
}
@@ -631,7 +626,7 @@ settings_changed (GSettings *settings,
else if (strcmp (key, "high-contrast") == 0)
high_contrast_changed (screen);
else
update_xft_settings (screen, TRUE);
update_xft_settings (screen);
}
}
@@ -663,7 +658,7 @@ apply_portal_setting (TranslationEntry *entry,
entry->fallback.i = get_order (g_variant_get_string (value, NULL));
else if (strcmp (entry->key, "text-scaling-factor") == 0)
entry->fallback.i = (int) (g_variant_get_double (value) * 65536.0);
update_xft_settings (screen, TRUE);
update_xft_settings (screen);
break;
default:
break;
@@ -844,7 +839,7 @@ fallback:
g_settings_schema_unref (schema);
}
update_xft_settings (screen, FALSE);
update_xft_settings (screen);
}
static void
@@ -1048,9 +1043,8 @@ set_capability_setting (GdkScreen *screen,
enum gtk_shell1_capability test)
{
GdkWaylandScreen *wayland_screen = GDK_WAYLAND_SCREEN (screen);
int testbit = 1 << (test - 1);
g_value_set_boolean (value, (wayland_screen->shell_capabilities & testbit) == testbit);
g_value_set_boolean (value, (wayland_screen->shell_capabilities & test) == test);
return TRUE;
}
@@ -1552,43 +1546,17 @@ should_expect_xdg_output_done (GdkWaylandMonitor *monitor)
static void
apply_monitor_change (GdkWaylandMonitor *monitor)
{
GDK_NOTE (MISC,
g_message ("monitor %d changed position %d %d, size %d %d",
monitor->id, monitor->output_geometry.x,
monitor->output_geometry.y,
monitor->output_geometry.width,
monitor->output_geometry.height));
GdkDisplay *display = GDK_MONITOR (monitor)->display;
GdkWaylandScreen *screen_wayland = GDK_WAYLAND_SCREEN (gdk_display_get_default_screen (display));
GdkRectangle logical_geometry;
gboolean needs_scaling = FALSE;
GDK_NOTE (MISC,
g_message ("monitor %d changed position %d %d, size %d %d",
monitor->id,
monitor->x, monitor->y,
monitor->width, monitor->height));
if (monitor->xdg_output_done)
{
logical_geometry = monitor->xdg_output_geometry;
needs_scaling =
logical_geometry.width == monitor->output_geometry.width ||
logical_geometry.height == monitor->output_geometry.height;
}
else
{
logical_geometry = monitor->output_geometry;
needs_scaling = TRUE;
}
if (needs_scaling)
{
int scale = gdk_monitor_get_scale_factor (GDK_MONITOR (monitor));
logical_geometry.y /= scale;
logical_geometry.x /= scale;
logical_geometry.width /= scale;
logical_geometry.height /= scale;
}
gdk_monitor_set_position (GDK_MONITOR (monitor), logical_geometry.x, logical_geometry.y);
gdk_monitor_set_size (GDK_MONITOR (monitor), logical_geometry.width, logical_geometry.height);
gdk_monitor_set_position (GDK_MONITOR (monitor), monitor->x, monitor->y);
gdk_monitor_set_size (GDK_MONITOR (monitor), monitor->width, monitor->height);
gdk_monitor_set_connector (GDK_MONITOR (monitor), monitor->name);
monitor->wl_output_done = FALSE;
monitor->xdg_output_done = FALSE;
@@ -1608,9 +1576,8 @@ xdg_output_handle_logical_position (void *data,
GDK_NOTE (MISC,
g_message ("handle logical position xdg-output %d, position %d %d",
monitor->id, x, y));
monitor->xdg_output_geometry.x = x;
monitor->xdg_output_geometry.y = y;
monitor->x = x;
monitor->y = y;
}
static void
@@ -1624,9 +1591,8 @@ xdg_output_handle_logical_size (void *data,
GDK_NOTE (MISC,
g_message ("handle logical size xdg-output %d, size %d %d",
monitor->id, width, height));
monitor->xdg_output_geometry.width = width;
monitor->xdg_output_geometry.height = height;
monitor->width = width;
monitor->height = height;
}
static void
@@ -1713,8 +1679,8 @@ output_handle_geometry (void *data,
g_message ("handle geometry output %d, position %d %d, phys. size %d %d, subpixel layout %s, manufacturer %s, model %s, transform %s",
monitor->id, x, y, physical_width, physical_height, subpixel_to_string (subpixel), make, model, transform_to_string (transform)));
monitor->output_geometry.x = x;
monitor->output_geometry.y = y;
monitor->x = x;
monitor->y = y;
switch (transform)
{
@@ -1759,13 +1725,29 @@ output_handle_scale (void *data,
int32_t scale)
{
GdkWaylandMonitor *monitor = (GdkWaylandMonitor *)data;
GdkRectangle previous_geometry;
int previous_scale;
int width;
int height;
GDK_NOTE (MISC,
g_message ("handle scale output %d, scale %d", monitor->id, scale));
gdk_monitor_get_geometry (GDK_MONITOR (monitor), &previous_geometry);
previous_scale = gdk_monitor_get_scale_factor (GDK_MONITOR (monitor));
/* Set the scale from wl_output protocol, regardless of xdg-output support */
gdk_monitor_set_scale_factor (GDK_MONITOR (monitor), scale);
if (monitor_has_xdg_output (monitor))
return;
width = previous_geometry.width * previous_scale;
height = previous_geometry.height * previous_scale;
monitor->width = width / scale;
monitor->height = height / scale;
if (should_update_monitor (monitor))
apply_monitor_change (monitor);
}
@@ -1779,6 +1761,7 @@ output_handle_mode (void *data,
int refresh)
{
GdkWaylandMonitor *monitor = (GdkWaylandMonitor *)data;
int scale;
GDK_NOTE (MISC,
g_message ("handle mode output %d, size %d %d, rate %d",
@@ -1787,8 +1770,9 @@ output_handle_mode (void *data,
if ((flags & WL_OUTPUT_MODE_CURRENT) == 0)
return;
monitor->output_geometry.width = width;
monitor->output_geometry.height = height;
scale = gdk_monitor_get_scale_factor (GDK_MONITOR (monitor));
monitor->width = width / scale;
monitor->height = height / scale;
gdk_monitor_set_refresh_rate (GDK_MONITOR (monitor), refresh);
if (should_update_monitor (monitor) || !monitor_has_xdg_output (monitor))
+3 -116
View File
@@ -148,7 +148,6 @@ struct _GdkWindowImplWayland
unsigned int pending_commit : 1;
unsigned int awaiting_frame : 1;
unsigned int using_csd : 1;
unsigned int suspended : 1;
GdkWindowTypeHint hint;
GdkWindow *transient_for;
GdkWindow *popup_parent;
@@ -226,7 +225,6 @@ struct _GdkWindowImplWayland
int width;
int height;
GdkWindowState state;
gboolean suspended;
} pending;
struct {
@@ -292,7 +290,6 @@ _gdk_window_impl_wayland_init (GdkWindowImplWayland *impl)
impl->initial_fullscreen_monitor = -1;
impl->saved_width = -1;
impl->saved_height = -1;
impl->suspended = FALSE;
}
static void
@@ -1082,14 +1079,6 @@ gdk_window_impl_wayland_end_paint (GdkWindow *window)
impl->pending_commit = TRUE;
}
else if (window->current_paint.use_gl &&
window->current_paint.surface_needs_composite &&
impl->pending_commit)
{
/* Discard issuing pending commit, as when we reach here, it means it'll
* be done implicitly by eglSwapBuffers(). */
impl->pending_commit = FALSE;
}
gdk_wayland_window_sync_margin (window);
gdk_wayland_window_sync_opaque_region (window);
@@ -1672,49 +1661,6 @@ should_use_fixed_size (GdkWindowState state)
GDK_WINDOW_STATE_TILED);
}
static gboolean
has_per_edge_tiling_info (GdkWindowState state)
{
return state & (GDK_WINDOW_STATE_TOP_TILED |
GDK_WINDOW_STATE_RIGHT_TILED |
GDK_WINDOW_STATE_BOTTOM_TILED |
GDK_WINDOW_STATE_LEFT_TILED);
}
static GdkWindowState
infer_edge_constraints (GdkWindowState state)
{
if (state & (GDK_WINDOW_STATE_MAXIMIZED | GDK_WINDOW_STATE_FULLSCREEN))
return state;
if (!(state & GDK_WINDOW_STATE_TILED) || !has_per_edge_tiling_info (state))
return state |
GDK_WINDOW_STATE_TOP_RESIZABLE |
GDK_WINDOW_STATE_RIGHT_RESIZABLE |
GDK_WINDOW_STATE_BOTTOM_RESIZABLE |
GDK_WINDOW_STATE_LEFT_RESIZABLE;
if (!(state & GDK_WINDOW_STATE_TOP_TILED))
state |= GDK_WINDOW_STATE_TOP_RESIZABLE;
if (!(state & GDK_WINDOW_STATE_RIGHT_TILED))
state |= GDK_WINDOW_STATE_RIGHT_RESIZABLE;
if (!(state & GDK_WINDOW_STATE_BOTTOM_TILED))
state |= GDK_WINDOW_STATE_BOTTOM_RESIZABLE;
if (!(state & GDK_WINDOW_STATE_LEFT_TILED))
state |= GDK_WINDOW_STATE_LEFT_RESIZABLE;
return state;
}
static gboolean
supports_native_edge_constraints (GdkWindowImplWayland *impl)
{
struct gtk_surface1 *gtk_surface = impl->display_server.gtk_surface;
if (!gtk_surface)
return FALSE;
return gtk_surface1_get_version (gtk_surface) >= GTK_SURFACE1_CONFIGURE_EDGES_SINCE_VERSION;
}
static void
gdk_wayland_window_handle_configure (GdkWindow *window,
uint32_t serial)
@@ -1722,9 +1668,7 @@ gdk_wayland_window_handle_configure (GdkWindow *window,
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
GdkWaylandDisplay *display_wayland =
GDK_WAYLAND_DISPLAY (gdk_window_get_display (window));
GdkFrameClock *frame_clock = gdk_window_get_frame_clock (window);
GdkWindowState new_state;
gboolean suspended;
int width = impl->pending.width;
int height = impl->pending.height;
gboolean fixed_size;
@@ -1748,25 +1692,9 @@ gdk_wayland_window_handle_configure (GdkWindow *window,
return;
}
suspended = impl->pending.suspended;
impl->pending.suspended = FALSE;
if (impl->suspended != suspended)
{
GdkEvent* event;
impl->suspended = suspended;
event = _gdk_make_event (window, GDK_VISIBILITY_NOTIFY, NULL, FALSE);
event->visibility.state = suspended ? GDK_VISIBILITY_FULLY_OBSCURED : GDK_VISIBILITY_UNOBSCURED;
}
new_state = impl->pending.state;
impl->pending.state = 0;
if (!supports_native_edge_constraints (impl))
new_state = infer_edge_constraints (new_state);
fixed_size = should_use_fixed_size (new_state);
saved_size = (width == 0 && height == 0);
@@ -1872,23 +1800,17 @@ gdk_wayland_window_handle_configure (GdkWindow *window,
if (impl->hint != GDK_WINDOW_TYPE_HINT_DIALOG &&
new_state & GDK_WINDOW_STATE_FOCUSED)
gdk_wayland_window_update_dialogs (window);
impl->pending_commit = TRUE;
gdk_frame_clock_request_phase (frame_clock,
GDK_FRAME_CLOCK_PHASE_AFTER_PAINT);
}
static void
gdk_wayland_window_handle_configure_toplevel (GdkWindow *window,
int32_t width,
int32_t height,
GdkWindowState state,
gboolean suspended)
GdkWindowState state)
{
GdkWindowImplWayland *impl = GDK_WINDOW_IMPL_WAYLAND (window->impl);
impl->pending.state |= state;
impl->pending.suspended |= suspended;
impl->pending.width = width;
impl->pending.height = height;
}
@@ -1934,7 +1856,6 @@ xdg_toplevel_configure (void *data,
GdkWindow *window = GDK_WINDOW (data);
uint32_t *p;
GdkWindowState pending_state = 0;
gboolean suspended = FALSE;
wl_array_for_each (p, states)
{
@@ -1953,23 +1874,6 @@ xdg_toplevel_configure (void *data,
break;
case XDG_TOPLEVEL_STATE_RESIZING:
break;
case XDG_TOPLEVEL_STATE_TILED_TOP:
pending_state |= (GDK_WINDOW_STATE_TILED | GDK_WINDOW_STATE_TOP_TILED);
break;
case XDG_TOPLEVEL_STATE_TILED_RIGHT:
pending_state |= (GDK_WINDOW_STATE_TILED | GDK_WINDOW_STATE_RIGHT_TILED);
break;
case XDG_TOPLEVEL_STATE_TILED_BOTTOM:
pending_state |= (GDK_WINDOW_STATE_TILED | GDK_WINDOW_STATE_BOTTOM_TILED);
break;
case XDG_TOPLEVEL_STATE_TILED_LEFT:
pending_state |= (GDK_WINDOW_STATE_TILED | GDK_WINDOW_STATE_LEFT_TILED);
break;
#ifdef HAVE_TOPLEVEL_STATE_SUSPENDED
case XDG_TOPLEVEL_STATE_SUSPENDED:
suspended = TRUE;
break;
#endif
default:
/* Unknown state */
break;
@@ -1977,7 +1881,7 @@ xdg_toplevel_configure (void *data,
}
gdk_wayland_window_handle_configure_toplevel (window, width, height,
pending_state, suspended);
pending_state);
}
static void
@@ -1989,26 +1893,9 @@ xdg_toplevel_close (void *data,
gdk_wayland_window_handle_close (window);
}
static void
xdg_toplevel_configure_bounds (void *data,
struct xdg_toplevel *xdg_toplevel,
int32_t width,
int32_t height)
{
}
static void
xdg_toplevel_wm_capabilities (void *data,
struct xdg_toplevel *xdg_toplevel,
struct wl_array *capabilities)
{
}
static const struct xdg_toplevel_listener xdg_toplevel_listener = {
xdg_toplevel_configure,
xdg_toplevel_close,
xdg_toplevel_configure_bounds,
xdg_toplevel_wm_capabilities,
};
static void
@@ -2081,7 +1968,7 @@ zxdg_toplevel_v6_configure (void *data,
}
gdk_wayland_window_handle_configure_toplevel (window, width, height,
pending_state, FALSE);
pending_state);
}
static void
+10 -25
View File
@@ -498,30 +498,17 @@ winpointer_enumerate_devices (GdkDeviceManagerWin32 *device_manager)
UINT32 i = 0;
GList *current = NULL;
if (!getPointerDevices (&infos_count, NULL))
do
{
WIN32_API_FAILED ("GetPointerDevices");
return;
}
infos = g_new0 (POINTER_DEVICE_INFO, infos_count);
/* Note: the device count may increase between the two
* calls. In such case, the second call will fail with
* ERROR_INSUFFICIENT_BUFFER.
* However we'll also get a new WM_POINTERDEVICECHANGE
* notification, which will start the enumeration again.
* So do not treat ERROR_INSUFFICIENT_BUFFER as an
* error, rather return and do the necessary work later
*/
if (!getPointerDevices (&infos_count, infos))
{
if (GetLastError() != ERROR_INSUFFICIENT_BUFFER)
WIN32_API_FAILED ("GetPointerDevices");
g_free (infos);
return;
infos = g_new0 (POINTER_DEVICE_INFO, infos_count);
if (!getPointerDevices (&infos_count, infos))
{
WIN32_API_FAILED ("GetPointerDevices");
g_free (infos);
return;
}
}
while (infos_count > 0 && !infos);
/* remove any gdk device not present anymore or update info */
current = device_manager->winpointer_devices;
@@ -533,11 +520,9 @@ winpointer_enumerate_devices (GdkDeviceManagerWin32 *device_manager)
if (!winpointer_match_device_in_system_list (device, infos, infos_count))
{
GdkSeat *seat = gdk_device_get_seat (GDK_DEVICE (device));
GdkDeviceTool *tool = (GDK_DEVICE (device))->last_tool;
gdk_device_update_tool (GDK_DEVICE (device), NULL);
gdk_seat_default_remove_tool (GDK_SEAT_DEFAULT (seat), tool);
g_clear_pointer (&tool, g_object_unref);
gdk_seat_default_remove_tool (GDK_SEAT_DEFAULT (seat), (GDK_DEVICE (device))->last_tool);
gdk_seat_default_remove_slave (GDK_SEAT_DEFAULT (seat), GDK_DEVICE (device));
device_manager->winpointer_devices = g_list_delete_link (device_manager->winpointer_devices,
+15 -36
View File
@@ -2879,14 +2879,10 @@ gdk_event_translate (MSG *msg,
break;
}
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
if (IS_POINTER_PRIMARY_WPARAM (msg->wParam))
{
pen_touch_cursor_position.x = GET_X_LPARAM (msg->lParam);
pen_touch_cursor_position.y = GET_Y_LPARAM (msg->lParam);
current_root_x = pen_touch_cursor_position.x / impl->window_scale;
current_root_y = pen_touch_cursor_position.y / impl->window_scale;
current_root_x = pen_touch_cursor_position.x = GET_X_LPARAM (msg->lParam);
current_root_y = pen_touch_cursor_position.y = GET_Y_LPARAM (msg->lParam);
pen_touch_input = TRUE;
last_digitizer_time = msg->time;
}
@@ -2913,14 +2909,10 @@ gdk_event_translate (MSG *msg,
break;
}
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
if (IS_POINTER_PRIMARY_WPARAM (msg->wParam))
{
pen_touch_cursor_position.x = GET_X_LPARAM (msg->lParam);
pen_touch_cursor_position.y = GET_Y_LPARAM (msg->lParam);
current_root_x = pen_touch_cursor_position.x / impl->window_scale;
current_root_y = pen_touch_cursor_position.y / impl->window_scale;
current_root_x = pen_touch_cursor_position.x = GET_X_LPARAM (msg->lParam);
current_root_y = pen_touch_cursor_position.y = GET_Y_LPARAM (msg->lParam);
pen_touch_input = TRUE;
last_digitizer_time = msg->time;
}
@@ -2932,6 +2924,7 @@ gdk_event_translate (MSG *msg,
gdk_winpointer_input_events (display, window, NULL, msg);
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
if (impl->drag_move_resize_context.op != GDK_WIN32_DRAGOP_NONE)
{
gdk_win32_window_end_move_resize_drag (window);
@@ -2949,14 +2942,10 @@ gdk_event_translate (MSG *msg,
break;
}
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
if (IS_POINTER_PRIMARY_WPARAM (msg->wParam))
{
pen_touch_cursor_position.x = GET_X_LPARAM (msg->lParam);
pen_touch_cursor_position.y = GET_Y_LPARAM (msg->lParam);
current_root_x = pen_touch_cursor_position.x / impl->window_scale;
current_root_y = pen_touch_cursor_position.y / impl->window_scale;
current_root_x = pen_touch_cursor_position.x = GET_X_LPARAM (msg->lParam);
current_root_y = pen_touch_cursor_position.y = GET_Y_LPARAM (msg->lParam);
pen_touch_input = TRUE;
last_digitizer_time = msg->time;
}
@@ -2969,6 +2958,8 @@ gdk_event_translate (MSG *msg,
if (IS_POINTER_PRIMARY_WPARAM (msg->wParam) && mouse_window != window)
crossing_cb = make_crossing_event;
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
if (impl->drag_move_resize_context.op != GDK_WIN32_DRAGOP_NONE)
{
gdk_win32_window_do_move_resize_drag (window, current_root_x, current_root_y);
@@ -2990,14 +2981,10 @@ gdk_event_translate (MSG *msg,
break;
}
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
if (IS_POINTER_PRIMARY_WPARAM (msg->wParam))
{
pen_touch_cursor_position.x = GET_X_LPARAM (msg->lParam);
pen_touch_cursor_position.y = GET_Y_LPARAM (msg->lParam);
current_root_x = pen_touch_cursor_position.x / impl->window_scale;
current_root_y = pen_touch_cursor_position.y / impl->window_scale;
current_root_x = pen_touch_cursor_position.x = GET_X_LPARAM (msg->lParam);
current_root_y = pen_touch_cursor_position.y = GET_Y_LPARAM (msg->lParam);
pen_touch_input = TRUE;
last_digitizer_time = msg->time;
}
@@ -3030,14 +3017,10 @@ gdk_event_translate (MSG *msg,
break;
}
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
if (IS_POINTER_PRIMARY_WPARAM (msg->wParam))
{
pen_touch_cursor_position.x = GET_X_LPARAM (msg->lParam);
pen_touch_cursor_position.y = GET_Y_LPARAM (msg->lParam);
current_root_x = pen_touch_cursor_position.x / impl->window_scale;
current_root_y = pen_touch_cursor_position.y / impl->window_scale;
current_root_x = pen_touch_cursor_position.x = GET_X_LPARAM (msg->lParam);
current_root_y = pen_touch_cursor_position.y = GET_Y_LPARAM (msg->lParam);
pen_touch_input = TRUE;
last_digitizer_time = msg->time;
}
@@ -3064,14 +3047,10 @@ gdk_event_translate (MSG *msg,
break;
}
impl = GDK_WINDOW_IMPL_WIN32 (window->impl);
if (IS_POINTER_PRIMARY_WPARAM (msg->wParam))
{
pen_touch_cursor_position.x = GET_X_LPARAM (msg->lParam);
pen_touch_cursor_position.y = GET_Y_LPARAM (msg->lParam);
current_root_x = pen_touch_cursor_position.x / impl->window_scale;
current_root_y = pen_touch_cursor_position.y / impl->window_scale;
current_root_x = pen_touch_cursor_position.x = GET_X_LPARAM (msg->lParam);
current_root_y = pen_touch_cursor_position.y = GET_Y_LPARAM (msg->lParam);
pen_touch_input = TRUE;
last_digitizer_time = msg->time;
}
+2 -2
View File
@@ -249,8 +249,8 @@ _get_keyboard_layout_file (const char *layout_name)
KEY_QUERY_VALUE, &hkey);
if (status != ERROR_SUCCESS)
{
g_debug("Could not open registry key '%s'. Error code: %d",
kbdKeyPath, (int)status);
g_warning("Could not open registry key '%s'. Error code: %d",
kbdKeyPath, (int)status);
goto fail1;
}
-12
View File
@@ -94,21 +94,9 @@ gdk_x11_monitor_init (GdkX11Monitor *monitor)
{
}
static void
gdk_x11_monitor_finalize (GObject *gobject)
{
GdkX11Monitor *self = GDK_X11_MONITOR (gobject);
g_free (self->name);
G_OBJECT_CLASS (gdk_x11_monitor_parent_class)->finalize (gobject);
}
static void
gdk_x11_monitor_class_init (GdkX11MonitorClass *class)
{
G_OBJECT_CLASS (class)->finalize = gdk_x11_monitor_finalize;
GDK_MONITOR_CLASS (class)->get_workarea = gdk_x11_monitor_get_workarea;
}
-1
View File
@@ -32,7 +32,6 @@ struct _GdkX11Monitor
GdkMonitor parent;
XID output;
char *name;
guint add : 1;
guint remove : 1;
};
+14 -35
View File
@@ -469,15 +469,14 @@ check_is_composited (GdkDisplay *display,
}
static GdkX11Monitor *
find_monitor_by_name (GdkX11Display *x11_display,
char *name)
find_monitor_by_output (GdkX11Display *x11_display, XID output)
{
int i;
for (i = 0; i < x11_display->monitors->len; i++)
{
GdkX11Monitor *monitor = x11_display->monitors->pdata[i];
if (g_strcmp0 (monitor->name, name) == 0)
if (monitor->output == output)
return monitor;
}
@@ -645,8 +644,7 @@ init_randr15 (GdkScreen *screen, gboolean *changed)
#undef EDID_LENGTH
}
name = gdk_x11_get_xatom_name_for_display (display, rr_monitors[i].name);
monitor = find_monitor_by_name (x11_display, name);
monitor = find_monitor_by_output (x11_display, output);
if (monitor)
monitor->remove = FALSE;
else
@@ -655,12 +653,12 @@ init_randr15 (GdkScreen *screen, gboolean *changed)
"display", display,
NULL);
monitor->output = output;
monitor->name = g_strdup (name);
monitor->add = TRUE;
g_ptr_array_add (x11_display->monitors, monitor);
}
gdk_monitor_get_geometry (GDK_MONITOR (monitor), &geometry);
name = g_strndup (output_info->name, output_info->nameLen);
newgeo.x = rr_monitors[i].x / x11_screen->window_scale;
newgeo.y = rr_monitors[i].y / x11_screen->window_scale;
@@ -689,6 +687,7 @@ init_randr15 (GdkScreen *screen, gboolean *changed)
gdk_monitor_set_connector (GDK_MONITOR (monitor), name);
gdk_monitor_set_manufacturer (GDK_MONITOR (monitor), manufacturer);
g_free (manufacturer);
g_free (name);
if (rr_monitors[i].primary)
primary_output = monitor->output;
@@ -795,13 +794,8 @@ init_randr13 (GdkScreen *screen, gboolean *changed)
for (i = 0; i < resources->noutput; ++i)
{
RROutput output = resources->outputs[i];
XRROutputInfo *output_info;
gdk_x11_display_error_trap_push (display);
output_info = XRRGetOutputInfo (x11_screen->xdisplay, resources, output);
if (gdk_x11_display_error_trap_pop (display))
continue;
XRROutputInfo *output_info =
XRRGetOutputInfo (x11_screen->xdisplay, resources, output);
/* Non RandR1.2+ X driver have output name "default" */
randr12_compat |= !g_strcmp0 (output_info->name, "default");
@@ -815,22 +809,13 @@ init_randr13 (GdkScreen *screen, gboolean *changed)
if (output_info->crtc)
{
GdkX11Monitor *monitor;
XRRCrtcInfo *crtc;
XRRCrtcInfo *crtc = XRRGetCrtcInfo (x11_screen->xdisplay, resources, output_info->crtc);
char *name;
GdkRectangle geometry;
GdkRectangle newgeo;
int j;
int refresh_rate = 0;
gdk_x11_display_error_trap_push (display);
crtc = XRRGetCrtcInfo (x11_screen->xdisplay, resources, output_info->crtc);
if (gdk_x11_display_error_trap_pop (display))
{
XRRFreeOutputInfo (output_info);
continue;
}
for (j = 0; j < resources->nmode; j++)
{
XRRModeInfo *xmode = &resources->modes[j];
@@ -842,8 +827,7 @@ init_randr13 (GdkScreen *screen, gboolean *changed)
}
}
name = g_strndup (output_info->name, output_info->nameLen);
monitor = find_monitor_by_name (x11_display, name);
monitor = find_monitor_by_output (x11_display, output);
if (monitor)
monitor->remove = FALSE;
else
@@ -851,13 +835,13 @@ init_randr13 (GdkScreen *screen, gboolean *changed)
monitor = g_object_new (gdk_x11_monitor_get_type (),
"display", display,
NULL);
monitor->name = g_strdup (name);
monitor->output = output;
monitor->add = TRUE;
g_ptr_array_add (x11_display->monitors, monitor);
}
gdk_monitor_get_geometry (GDK_MONITOR (monitor), &geometry);
name = g_strndup (output_info->name, output_info->nameLen);
newgeo.x = crtc->x / x11_screen->window_scale;
newgeo.y = crtc->y / x11_screen->window_scale;
@@ -929,11 +913,8 @@ init_randr13 (GdkScreen *screen, gboolean *changed)
old_primary = x11_display->primary_monitor;
x11_display->primary_monitor = 0;
gdk_x11_display_error_trap_push (display);
primary_output = XRRGetOutputPrimary (x11_screen->xdisplay,
x11_screen->xroot_window);
gdk_x11_display_error_trap_pop_ignored (display);
for (i = 0; i < x11_display->monitors->len; ++i)
{
@@ -984,15 +965,13 @@ init_no_multihead (GdkScreen *screen, gboolean *changed)
monitor->remove = TRUE;
}
if (x11_display->monitors->len > 0)
{
monitor = x11_display->monitors->pdata[0];
monitor->remove = FALSE;
}
monitor = find_monitor_by_output (x11_display, 0);
if (monitor)
monitor->remove = FALSE;
else
{
monitor = g_object_new (gdk_x11_monitor_get_type (),
"display", display,
"display", x11_display,
NULL);
monitor->output = 0;
monitor->add = TRUE;
+3 -1
View File
@@ -525,9 +525,11 @@ gail_focus_notify (GtkWidget *widget)
/*
* Do not report focus on redundant object
*/
G_GNUC_BEGIN_IGNORE_DEPRECATIONS;
if (atk_obj &&
(atk_object_get_role(atk_obj) != ATK_ROLE_REDUNDANT_OBJECT))
atk_object_notify_state_change (atk_obj, ATK_STATE_FOCUSED, TRUE);
atk_focus_tracker_notify (atk_obj);
G_GNUC_END_IGNORE_DEPRECATIONS;
if (atk_obj && transient)
g_object_unref (atk_obj);
if (subsequent_focus_widget)
+1 -1
View File
@@ -401,7 +401,7 @@ gtk_cell_accessible_get_position (AtkTableCell *table_cell,
gtk_cell_accessible_parent_get_cell_position (GTK_CELL_ACCESSIBLE_PARENT (parent),
cell,
row, column);
return ((row && *row >= 0) || (column && *column >= 0));
return ((row && *row > 0) || (column && *column > 0));
}
static int
+2 -2
View File
@@ -1297,8 +1297,8 @@ gtk_handle_box_button_press (GtkWidget *widget,
}
priv->in_drag = TRUE;
priv->grab_device = event->device;
fleur = gdk_cursor_new_from_name (gtk_widget_get_display (widget),
"move");
fleur = gdk_cursor_new_for_display (gtk_widget_get_display (widget),
GDK_FLEUR);
if (gdk_device_grab (event->device,
gtk_widget_get_window (invisible),
GDK_OWNERSHIP_WINDOW,
+2 -2
View File
@@ -616,8 +616,8 @@ set_cross_grab (GtkHSV *hsv,
GtkHSVPrivate *priv = hsv->priv;
GdkCursor *cursor;
cursor = gdk_cursor_new_from_name (gtk_widget_get_display (GTK_WIDGET (hsv)),
"crosshair");
cursor = gdk_cursor_new_for_display (gtk_widget_get_display (GTK_WIDGET (hsv)),
GDK_CROSSHAIR);
gdk_device_grab (device,
priv->window,
GDK_OWNERSHIP_NONE,
BIN
View File
Binary file not shown.
+1 -1
View File
@@ -122,7 +122,7 @@ main (int argc, char *argv[])
continue;
group = json_object_get_int_member (obj, "group");
name = json_object_get_string_member (obj, "label");
name = json_object_get_string_member (obj, "annotation");
if (json_object_has_member (obj, "skins"))
{
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
+6 -15
View File
@@ -248,10 +248,8 @@ ss_get_active_cb (GObject *source,
ret = g_dbus_proxy_call_finish (proxy, result, &error);
if (ret == NULL)
{
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
g_warning ("Getting screensaver status failed: %s",
error ? error->message : "");
g_clear_error (&error);
g_warning ("Getting screensaver status failed: %s", error->message);
g_error_free (error);
return;
}
@@ -272,10 +270,8 @@ create_monitor_cb (GObject *source,
ret = g_dbus_proxy_call_finish (proxy, result, &error);
if (ret == NULL)
{
if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
g_warning ("Creating a portal monitor failed: %s",
error ? error->message : "");
g_clear_error (&error);
g_warning ("Creating a portal monitor failed: %s", error->message);
g_error_free (error);
return;
}
@@ -306,8 +302,6 @@ gtk_application_impl_dbus_startup (GtkApplicationImpl *impl,
if (gtk_should_use_portal ())
goto out;
dbus->cancellable = g_cancellable_new ();
g_debug ("Connecting to session manager");
/* Try the GNOME session manager first */
@@ -374,7 +368,7 @@ gtk_application_impl_dbus_startup (GtkApplicationImpl *impl,
NULL,
G_DBUS_CALL_FLAGS_NONE,
G_MAXINT,
dbus->cancellable,
NULL,
ss_get_active_cb,
dbus);
}
@@ -521,7 +515,7 @@ gtk_application_impl_dbus_startup (GtkApplicationImpl *impl,
g_variant_new ("(sa{sv})", "", &opt_builder),
G_DBUS_CALL_FLAGS_NONE,
G_MAXINT,
dbus->cancellable,
NULL,
create_monitor_cb, dbus);
g_free (token);
}
@@ -533,8 +527,6 @@ end:;
static void
gtk_application_impl_dbus_shutdown (GtkApplicationImpl *impl)
{
GtkApplicationImplDBus *dbus = (GtkApplicationImplDBus *) impl;
g_cancellable_cancel (dbus->cancellable);
}
GQuark gtk_application_impl_dbus_export_id_quark (void);
@@ -910,7 +902,6 @@ gtk_application_impl_dbus_finalize (GObject *object)
if (dbus->ss_proxy)
g_signal_handlers_disconnect_by_func (dbus->ss_proxy, screensaver_signal_session, dbus->impl.application);
g_clear_object (&dbus->ss_proxy);
g_clear_object (&dbus->cancellable);
G_OBJECT_CLASS (gtk_application_impl_dbus_parent_class)->finalize (object);
}
-6
View File
@@ -68,7 +68,6 @@ G_DEFINE_TYPE (GtkApplicationImplQuartz, gtk_application_impl_quartz, GTK_TYPE_A
- (id)initWithImpl:(GtkApplicationImplQuartz*)impl;
- (NSApplicationTerminateReply) applicationShouldTerminate:(NSApplication *)sender;
- (void)application:(NSApplication *)theApplication openFiles:(NSArray *)filenames;
- (BOOL)applicationSupportsSecureRestorableState:(NSApplication *)app;
@end
@implementation GtkApplicationQuartzDelegate
@@ -124,11 +123,6 @@ G_DEFINE_TYPE (GtkApplicationImplQuartz, gtk_application_impl_quartz, GTK_TYPE_A
[theApplication replyToOpenOrPrint:NSApplicationDelegateReplySuccess];
}
-(BOOL)applicationSupportsSecureRestorableState:(NSApplication *)app
{
return YES;
}
@end
/* these exist only for accel handling */
-1
View File
@@ -117,7 +117,6 @@ typedef struct
GtkApplicationImpl impl;
GDBusConnection *session;
GCancellable *cancellable;
const gchar *application_id;
const gchar *unique_name;
+1
View File
@@ -170,6 +170,7 @@ gtk_box_gadget_distribute (GtkBoxGadget *gadget,
if G_UNLIKELY (size < 0)
{
g_critical ("%s: assertion 'size >= 0' failed in %s", G_STRFUNC, G_OBJECT_TYPE_NAME (gtk_css_gadget_get_owner (GTK_CSS_GADGET (gadget))));
return;
}
+1 -1
View File
@@ -373,7 +373,7 @@ _gtk_css_parser_read_char (GtkCssParser *parser,
parser->data++;
return TRUE;
}
if ((*(guchar *) parser->data) >= 128)
if (*parser->data >= 127)
{
gsize len = g_utf8_skip[(guint) *(guchar *) parser->data];
+1 -1
View File
@@ -966,7 +966,7 @@ pack_border (GtkCssShorthandProperty *shorthand,
{
GtkCssStyleProperty *prop;
GtkBorder border;
GValue v = G_VALUE_INIT;
GValue v;
prop = _gtk_css_shorthand_property_get_subproperty (shorthand, 0);
_gtk_style_property_query (GTK_STYLE_PROPERTY (prop), &v, query_func, query_data);
+2 -2
View File
@@ -4724,7 +4724,7 @@ gtk_entry_drag_gesture_update (GtkGestureDrag *gesture,
button = gtk_gesture_single_get_current_button (GTK_GESTURE_SINGLE (gesture));
gtk_drag_begin_with_coordinates (widget, target_list, actions,
button, (GdkEvent*) event,
priv->drag_start_x + (n_ranges > 0 ? ranges[0] : 0),
priv->drag_start_x + ranges[0],
priv->drag_start_y);
g_free (ranges);
@@ -9931,7 +9931,7 @@ gtk_entry_drag_begin (GtkWidget *widget,
gtk_entry_get_pixel_ranges (entry, &ranges, &n_ranges);
cairo_surface_get_device_scale (surface, &sx, &sy);
cairo_surface_set_device_offset (surface,
-(priv->drag_start_x - (n_ranges > 0 ? ranges[0] : 0)) * sx,
-(priv->drag_start_x - ranges[0]) * sx,
-(priv->drag_start_y) * sy);
g_free (ranges);
+12 -1
View File
@@ -184,8 +184,10 @@ static void gtk_expander_realize (GtkWidget *widget);
static void gtk_expander_unrealize (GtkWidget *widget);
static void gtk_expander_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static void gtk_expander_map (GtkWidget *widget);
static void gtk_expander_unmap (GtkWidget *widget);
static gboolean gtk_expander_draw (GtkWidget *widget,
cairo_t *cr);
@@ -204,6 +206,9 @@ static void gtk_expander_drag_leave (GtkWidget *widget,
GdkDragContext *context,
guint time);
static void gtk_expander_update_child_mapped (GtkExpander *expander,
GtkWidget *child);
static void gtk_expander_add (GtkContainer *container,
GtkWidget *widget);
static void gtk_expander_remove (GtkContainer *container,
@@ -696,7 +701,8 @@ gtk_expander_size_allocate (GtkWidget *widget,
static void
gtk_expander_map (GtkWidget *widget)
{
GtkExpanderPrivate *priv = GTK_EXPANDER (widget)->priv;
GtkExpander *expander = GTK_EXPANDER (widget);
GtkExpanderPrivate *priv = expander->priv;
if (priv->label_widget)
gtk_widget_map (priv->label_widget);
@@ -705,6 +711,8 @@ gtk_expander_map (GtkWidget *widget)
if (priv->event_window)
gdk_window_show (priv->event_window);
gtk_expander_update_child_mapped (expander, NULL);
}
static void
@@ -1101,6 +1109,9 @@ gtk_expander_update_child_mapped (GtkExpander *expander,
* not, so otherwise the child is not drawn but still consumes input in-place.
*/
if (child == NULL)
child = gtk_bin_get_child (GTK_BIN (expander));
if (expander->priv->expanded &&
gtk_widget_get_realized (child) &&
gtk_widget_get_visible (child))
-1
View File
@@ -759,7 +759,6 @@ refresh_current_folder_and_file_part (GtkFileChooserEntry *chooser_entry)
filter = gtk_file_filter_new ();
pattern = g_strconcat (chooser_entry->file_part, "*", NULL);
gtk_file_filter_add_pattern (filter, pattern);
g_object_ref_sink (filter);
_gtk_file_system_model_set_filter (GTK_FILE_SYSTEM_MODEL (chooser_entry->completion_store),
filter);
+37 -54
View File
@@ -23,16 +23,24 @@
#include "gtknativedialogprivate.h"
#include "gtkprivate.h"
#include "gtkdialog.h"
#include "gtkfilechooserdialog.h"
#include "gtkfilechooserprivate.h"
#include "gtkinvisible.h"
#include "gtkfilechooserwidget.h"
#include "gtkfilechooserwidgetprivate.h"
#include "gtkfilechooserutils.h"
#include "gtkfilechooserembed.h"
#include "gtkfilesystem.h"
#include "gtksizerequest.h"
#include "gtktypebuiltins.h"
#include "gtkintl.h"
#include "gtksettings.h"
#include "gtktogglebutton.h"
#include "gtkstylecontext.h"
#include "gtkheaderbar.h"
#include "gtklabel.h"
#include "gtkmain.h"
#include "gtkinvisible.h"
#include "gtkfilechooserentry.h"
#include "gtkfilefilterprivate.h"
#include "gtkwindowprivate.h"
@@ -55,51 +63,36 @@ typedef struct {
static void
filechooser_portal_data_clear (FilechooserPortalData *data)
filechooser_portal_data_free (FilechooserPortalData *data)
{
if (data->portal_response_signal_id != 0)
{
g_dbus_connection_signal_unsubscribe (data->connection,
data->portal_response_signal_id);
data->portal_response_signal_id = 0;
}
g_dbus_connection_signal_unsubscribe (data->connection,
data->portal_response_signal_id);
g_clear_object (&data->connection);
g_object_unref (data->connection);
if (data->grab_widget)
{
gtk_grab_remove (data->grab_widget);
gtk_widget_destroy (data->grab_widget);
data->grab_widget = NULL;
}
g_clear_object (&data->self);
if (data->exported_window)
{
gtk_window_unexport_handle (data->exported_window);
data->exported_window = NULL;
}
gtk_window_unexport_handle (data->exported_window);
g_clear_pointer (&data->portal_handle, g_free);
}
g_free (data->portal_handle);
static void
filechooser_portal_data_free (FilechooserPortalData *data)
{
if (data != NULL)
{
filechooser_portal_data_clear (data);
g_free (data);
}
g_free (data);
}
static void
response_cb (GDBusConnection *connection,
const char *sender_name,
const char *object_path,
const char *interface_name,
const char *signal_name,
const gchar *sender_name,
const gchar *object_path,
const gchar *interface_name,
const gchar *signal_name,
GVariant *parameters,
gpointer user_data)
{
@@ -133,7 +126,7 @@ response_cb (GDBusConnection *connection,
if (current_filter)
{
GtkFileFilter *filter = gtk_file_filter_new_from_gvariant (current_filter);
const char *current_filter_name = gtk_file_filter_get_name (filter);
const gchar *current_filter_name = gtk_file_filter_get_name (filter);
/* Try to find the given filter in the list of filters.
* Since filters are compared by pointer value, using the passed
@@ -164,10 +157,6 @@ response_cb (GDBusConnection *connection,
self->custom_files = NULL;
for (i = 0; uris[i]; i++)
self->custom_files = g_slist_prepend (self->custom_files, g_file_new_for_uri (uris[i]));
self->custom_files = g_slist_reverse (self->custom_files);
g_free (uris);
g_variant_unref (response_data);
switch (portal_response)
{
@@ -183,18 +172,10 @@ response_cb (GDBusConnection *connection,
break;
}
/* Keep a reference on the native dialog until we can emit the response
* signal; filechooser_portal_data_free() will drop a reference on the
* dialog as well
*/
g_object_ref (self);
filechooser_portal_data_free (data);
self->mode_data = NULL;
_gtk_native_dialog_emit_response (GTK_NATIVE_DIALOG (self), gtk_response);
g_object_unref (self);
}
static void
@@ -204,9 +185,11 @@ send_close (FilechooserPortalData *data)
GError *error = NULL;
message = g_dbus_message_new_method_call ("org.freedesktop.portal.Desktop",
data->portal_handle,
"org.freedesktop.portal.Request",
"/org/freedesktop/portal/desktop",
"org.freedesktop.portal.FileChooser",
"Close");
g_dbus_message_set_body (message,
g_variant_new ("(o)", data->portal_handle));
if (!g_dbus_connection_send_message (data->connection,
message,
@@ -239,11 +222,11 @@ open_file_msg_cb (GObject *source_object,
if (reply == NULL)
{
if (!data->hidden)
{
filechooser_portal_data_free (data);
self->mode_data = NULL;
}
_gtk_native_dialog_emit_response (GTK_NATIVE_DIALOG (self), GTK_RESPONSE_DELETE_EVENT);
g_warning ("Can't open portal file chooser: %s", error->message);
g_error_free (error);
filechooser_portal_data_free (data);
self->mode_data = NULL;
return;
}
@@ -252,6 +235,7 @@ open_file_msg_cb (GObject *source_object,
if (data->hidden)
{
/* The dialog was hidden before we got the handle, close it now */
send_close (data);
filechooser_portal_data_free (data);
self->mode_data = NULL;
}
@@ -392,7 +376,7 @@ show_portal_file_chooser (GtkFileChooserNative *self,
g_variant_new_string (GTK_FILE_CHOOSER_NATIVE (self)->current_name));
if (self->current_folder)
{
char *path;
gchar *path;
path = g_file_get_path (GTK_FILE_CHOOSER_NATIVE (self)->current_folder);
g_variant_builder_add (&opt_builder, "{sv}", "current_folder",
@@ -401,7 +385,7 @@ show_portal_file_chooser (GtkFileChooserNative *self,
}
if (self->current_file)
{
char *path;
gchar *path;
path = g_file_get_path (GTK_FILE_CHOOSER_NATIVE (self)->current_file);
g_variant_builder_add (&opt_builder, "{sv}", "current_file",
@@ -534,11 +518,10 @@ gtk_file_chooser_native_portal_hide (GtkFileChooserNative *self)
data->hidden = TRUE;
if (data->portal_handle)
send_close (data);
{
send_close (data);
filechooser_portal_data_free (data);
}
/* We clear the data because we might have in-flight async
* operations that can still access it
*/
filechooser_portal_data_clear (data);
self->mode_data = NULL;
}
-1
View File
@@ -40,7 +40,6 @@
#include "gtklabel.h"
#include "gtkfilechooserentry.h"
#include "gtkfilefilterprivate.h"
#include <quartz/gdkquartz.h>
#include <quartz/gdkquartz-cocoa-access.h>
#if MAC_OS_X_VERSION_MAX_ALLOWED >= 1060
+2 -5
View File
@@ -504,11 +504,8 @@ _update_widget_coordinates (GtkGesture *gesture,
gtk_widget_translate_coordinates (event_widget, widget,
event_x, event_y, &x, &y);
/* gtk_widget_translate() loses the fractional part so we need to
* add it back to not lose accuracy */
data->widget_x = x + (event_x - (int)event_x);
data->widget_y = y + (event_y - (int)event_y);
data->widget_x = x;
data->widget_y = y;
}
static GtkEventSequenceState
+2 -2
View File
@@ -5455,8 +5455,8 @@ gtk_label_create_window (GtkLabel *label)
attributes_mask = GDK_WA_X | GDK_WA_Y | GDK_WA_NOREDIR;
if (gtk_widget_is_sensitive (widget) && priv->select_info->selectable)
{
attributes.cursor = gdk_cursor_new_from_name (gtk_widget_get_display (widget),
"text");
attributes.cursor = gdk_cursor_new_for_display (gtk_widget_get_display (widget),
GDK_XTERM);
attributes_mask |= GDK_WA_CURSOR;
}
+1 -20
View File
@@ -5218,8 +5218,7 @@ gtk_menu_position (GtkMenu *menu,
rect_anchor_dx = priv->rect_anchor_dx;
rect_anchor_dy = priv->rect_anchor_dy;
if (priv->rect_window &&
!GDK_PRIVATE_CALL (gdk_window_is_impl_offscreen (priv->rect_window)))
if (priv->rect_window)
{
rect_window = priv->rect_window;
rect = priv->rect;
@@ -5264,24 +5263,6 @@ gtk_menu_position (GtkMenu *menu,
}
}
if (rect_window != NULL &&
GDK_PRIVATE_CALL (gdk_window_is_impl_offscreen (rect_window)))
{
GdkWindow *effective = gdk_offscreen_window_get_embedder (rect_window);
if (effective)
{
double x = rect.x, y = rect.y;
gdk_window_coords_to_parent (rect_window, x, y, &x, &y);
rect.x = x;
rect.y = y;
}
rect_window = effective;
}
if (!rect_window)
{
gtk_window_set_unlimited_guessed_size (GTK_WINDOW (priv->toplevel),
+11 -13
View File
@@ -195,8 +195,7 @@ indicator_is_left (GtkWidget *widget)
}
static void
gtk_model_button_update_state (GtkModelButton *button,
GtkStateFlags previous_flags)
gtk_model_button_update_state (GtkModelButton *button)
{
GtkStateFlags state;
GtkStateFlags indicator_state;
@@ -253,10 +252,9 @@ gtk_model_button_update_state (GtkModelButton *button,
button->role == GTK_BUTTON_ROLE_RADIO)
{
AtkObject *object = _gtk_widget_peek_accessible (GTK_WIDGET (button));
gboolean was_checked = (previous_flags & GTK_STATE_FLAG_CHECKED) != 0;
gboolean is_checked = (indicator_state & GTK_STATE_FLAG_CHECKED) != 0;
if (object && (was_checked != is_checked))
atk_object_notify_state_change (object, ATK_STATE_CHECKED, is_checked);
if (object)
atk_object_notify_state_change (object, ATK_STATE_CHECKED,
(indicator_state & GTK_STATE_FLAG_CHECKED));
}
}
@@ -292,7 +290,7 @@ static void
gtk_model_button_state_flags_changed (GtkWidget *widget,
GtkStateFlags previous_flags)
{
gtk_model_button_update_state (GTK_MODEL_BUTTON (widget), previous_flags);
gtk_model_button_update_state (GTK_MODEL_BUTTON (widget));
GTK_WIDGET_CLASS (gtk_model_button_parent_class)->state_flags_changed (widget, previous_flags);
}
@@ -303,7 +301,7 @@ gtk_model_button_direction_changed (GtkWidget *widget,
{
GtkModelButton *button = GTK_MODEL_BUTTON (widget);
gtk_model_button_update_state (button, GTK_STATE_FLAG_NORMAL);
gtk_model_button_update_state (button);
update_node_ordering (button);
GTK_WIDGET_CLASS (gtk_model_button_parent_class)->direction_changed (widget, previous_dir);
@@ -372,7 +370,7 @@ gtk_model_button_set_role (GtkModelButton *button,
update_node_name (button);
gtk_model_button_update_state (button, GTK_STATE_FLAG_NORMAL);
gtk_model_button_update_state (button);
gtk_widget_queue_draw (GTK_WIDGET (button));
g_object_notify_by_pspec (G_OBJECT (button), properties[PROP_ROLE]);
}
@@ -430,7 +428,7 @@ gtk_model_button_set_active (GtkModelButton *button,
return;
button->active = active;
gtk_model_button_update_state (button, GTK_STATE_FLAG_NORMAL);
gtk_model_button_update_state (button);
gtk_widget_queue_draw (GTK_WIDGET (button));
g_object_notify_by_pspec (G_OBJECT (button), properties[PROP_ACTIVE]);
}
@@ -443,7 +441,7 @@ gtk_model_button_set_menu_name (GtkModelButton *button,
button->menu_name = g_strdup (menu_name);
update_node_name (button);
gtk_model_button_update_state (button, GTK_STATE_FLAG_NORMAL);
gtk_model_button_update_state (button);
gtk_widget_queue_resize (GTK_WIDGET (button));
g_object_notify_by_pspec (G_OBJECT (button), properties[PROP_MENU_NAME]);
@@ -458,7 +456,7 @@ gtk_model_button_set_inverted (GtkModelButton *button,
return;
button->inverted = inverted;
gtk_model_button_update_state (button, GTK_STATE_FLAG_NORMAL);
gtk_model_button_update_state (button);
update_node_ordering (button);
gtk_widget_queue_resize (GTK_WIDGET (button));
g_object_notify_by_pspec (G_OBJECT (button), properties[PROP_INVERTED]);
@@ -1108,7 +1106,7 @@ gtk_model_button_get_accessible (GtkWidget *widget)
object = GTK_WIDGET_CLASS (gtk_model_button_parent_class)->get_accessible (widget);
gtk_model_button_update_state (GTK_MODEL_BUTTON (widget), GTK_STATE_FLAG_NORMAL);
gtk_model_button_update_state (GTK_MODEL_BUTTON (widget));
return object;
}
-5
View File
@@ -380,11 +380,6 @@ pw_dialog_got_response (GtkDialog *dialog,
else
g_mount_operation_reply (op, G_MOUNT_OPERATION_ABORTED);
if (priv->user_widgets)
{
g_list_free (priv->user_widgets);
priv->user_widgets = NULL;
}
priv->dialog = NULL;
g_object_notify (G_OBJECT (op), "is-showing");
gtk_widget_destroy (GTK_WIDGET (dialog));
+14 -95
View File
@@ -1506,10 +1506,10 @@ gtk_path_bar_update_button_appearance (GtkPathBar *path_bar,
static ButtonType
find_button_type (GtkPathBar *path_bar,
GFile *file,
GFile *root_file)
GFile *file)
{
if (root_file != NULL && g_file_equal (file, root_file))
if (path_bar->priv->root_file != NULL &&
g_file_equal (file, path_bar->priv->root_file))
return ROOT_BUTTON;
if (path_bar->priv->home_file != NULL &&
g_file_equal (file, path_bar->priv->home_file))
@@ -1546,7 +1546,6 @@ static ButtonData *
make_directory_button (GtkPathBar *path_bar,
const char *dir_name,
GFile *file,
GFile *root_file,
gboolean current_dir,
gboolean file_is_hidden)
{
@@ -1557,7 +1556,7 @@ make_directory_button (GtkPathBar *path_bar,
file_is_hidden = !! file_is_hidden;
/* Is it a special button? */
button_data = g_new0 (ButtonData, 1);
button_data->type = find_button_type (path_bar, file, root_file);
button_data->type = find_button_type (path_bar, file);
button_data->button = gtk_toggle_button_new ();
atk_obj = gtk_widget_get_accessible (button_data->button);
gtk_widget_set_focus_on_click (button_data->button, FALSE);
@@ -1679,9 +1678,6 @@ struct SetFileInfo
GList *new_buttons;
GList *fake_root;
gboolean first_directory;
GFile *root_file;
GCancellable *cancellable;
};
static void
@@ -1729,8 +1725,6 @@ gtk_path_bar_set_file_finish (struct SetFileInfo *info,
g_object_unref (info->file);
if (info->parent_file)
g_object_unref (info->parent_file);
if (info->root_file)
g_object_unref (info->root_file);
g_free (info);
}
@@ -1754,6 +1748,9 @@ gtk_path_bar_get_info_callback (GCancellable *cancellable,
return;
}
g_assert (GTK_IS_PATH_BAR (file_info->path_bar));
g_assert (G_OBJECT (file_info->path_bar)->ref_count > 0);
g_assert (cancellable == file_info->path_bar->priv->get_info_cancellable);
cancellable_async_done (file_info->path_bar, cancellable);
file_info->path_bar->priv->get_info_cancellable = NULL;
@@ -1770,7 +1767,6 @@ gtk_path_bar_get_info_callback (GCancellable *cancellable,
button_data = make_directory_button (file_info->path_bar, display_name,
file_info->file,
file_info->root_file,
file_info->first_directory, is_hidden);
g_clear_object (&file_info->file);
@@ -1793,10 +1789,7 @@ gtk_path_bar_get_info_callback (GCancellable *cancellable,
return;
}
if (g_file_equal (file_info->file, file_info->root_file))
file_info->parent_file = NULL;
else
file_info->parent_file = g_file_get_parent (file_info->file);
file_info->parent_file = g_file_get_parent (file_info->file);
/* Recurse asynchronously */
file_info->path_bar->priv->get_info_cancellable =
@@ -1808,63 +1801,6 @@ gtk_path_bar_get_info_callback (GCancellable *cancellable,
add_cancellable (file_info->path_bar, file_info->path_bar->priv->get_info_cancellable);
}
static void
gtk_path_bar_get_mount_callback (GObject *source,
GAsyncResult *result,
gpointer data)
{
GFile *file = G_FILE (source);
struct SetFileInfo *file_info = data;
GMount *mount;
GError *error = NULL;
gdk_threads_enter ();
mount = g_file_find_enclosing_mount_finish (file, result, &error);
if (g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED))
{
gtk_path_bar_set_file_finish (file_info, FALSE);
g_clear_error (&error);
gdk_threads_leave ();
return;
}
g_clear_error (&error);
if (mount)
{
file_info->root_file = g_mount_get_root (mount);
g_object_unref (mount);
}
if (file_info->root_file == NULL)
file_info->root_file = g_object_ref (file_info->path_bar->priv->root_file);
if (g_file_equal (file_info->file, file_info->root_file))
file_info->parent_file = NULL;
else
file_info->parent_file = g_file_get_parent (file_info->file);
cancellable_async_done (file_info->path_bar, file_info->cancellable);
if (file_info->path_bar->priv->get_info_cancellable == file_info->cancellable)
file_info->path_bar->priv->get_info_cancellable = NULL;
file_info->cancellable = NULL;
/* Recurse asynchronously */
file_info->path_bar->priv->get_info_cancellable =
_gtk_file_system_get_info (file_info->path_bar->priv->file_system,
file_info->file,
"standard::display-name,standard::is-hidden,standard::is-backup",
gtk_path_bar_get_info_callback,
file_info);
add_cancellable (file_info->path_bar,
file_info->path_bar->priv->get_info_cancellable);
gdk_threads_leave ();
}
void
_gtk_path_bar_set_file (GtkPathBar *path_bar,
GFile *file,
@@ -1892,29 +1828,12 @@ _gtk_path_bar_set_file (GtkPathBar *path_bar,
cancel_cancellable (path_bar, path_bar->priv->get_info_cancellable);
}
if (g_file_is_native (info->file))
{
info->root_file = g_object_ref (path_bar->priv->root_file);
info->parent_file = g_file_get_parent (info->file);
path_bar->priv->get_info_cancellable =
_gtk_file_system_get_info (path_bar->priv->file_system,
info->file,
"standard::display-name,standard::is-hidden,standard::is-backup",
gtk_path_bar_get_info_callback,
info);
}
else
{
info->cancellable = g_cancellable_new ();
path_bar->priv->get_info_cancellable = info->cancellable;
g_file_find_enclosing_mount_async (info->file,
G_PRIORITY_DEFAULT,
info->cancellable,
gtk_path_bar_get_mount_callback,
info);
}
path_bar->priv->get_info_cancellable =
_gtk_file_system_get_info (path_bar->priv->file_system,
info->file,
"standard::display-name,standard::is-hidden,standard::is-backup",
gtk_path_bar_get_info_callback,
info);
add_cancellable (path_bar, path_bar->priv->get_info_cancellable);
}
+9 -10
View File
@@ -112,7 +112,6 @@
#include "gtkstylecontextprivate.h"
#include "gtkprogresstrackerprivate.h"
#include "gtksettingsprivate.h"
#include <string.h> /* memset */
#ifdef GDK_WINDOWING_WAYLAND
#include "wayland/gdkwayland.h"
@@ -2317,7 +2316,7 @@ gtk_popover_set_pointing_to (GtkPopover *popover,
* If a rectangle to point to has been set, this function will
* return %TRUE and fill in @rect with such rectangle, otherwise
* it will return %FALSE and fill in @rect with the attached
* widget width and height if a widget exists, otherwise it will zero-out @rect.
* widget coordinates.
*
* Returns: %TRUE if a rectangle to point to was set.
**/
@@ -2328,17 +2327,17 @@ gtk_popover_get_pointing_to (GtkPopover *popover,
GtkPopoverPrivate *priv = gtk_popover_get_instance_private (popover);
g_return_val_if_fail (GTK_IS_POPOVER (popover), FALSE);
g_return_val_if_fail (rect != NULL, FALSE);
if (priv->has_pointing_to)
*rect = priv->pointing_to;
else if (priv->widget)
if (rect)
{
gtk_widget_get_allocation (priv->widget, rect);
rect->x = rect->y = 0;
if (priv->has_pointing_to)
*rect = priv->pointing_to;
else if (priv->widget)
{
gtk_widget_get_allocation (priv->widget, rect);
rect->x = rect->y = 0;
}
}
else
memset (rect, 0, sizeof (GdkRectangle));
return priv->has_pointing_to;
}
+1 -1
View File
@@ -92,7 +92,7 @@ gboolean _gtk_propagate_captured_event (GtkWidget *widget,
GtkWidget *topmost);
gdouble _gtk_get_slowdown (void);
gdouble _gtk_get_slowdown ();
void _gtk_set_slowdown (gdouble slowdown_factor);
gboolean gtk_should_use_portal (void);
+1 -1
View File
@@ -45,7 +45,7 @@ _gtk_set_slowdown (gdouble factor)
}
gdouble
_gtk_get_slowdown (void)
_gtk_get_slowdown (gdouble factor)
{
return gtk_slowdown;
}
+6 -7
View File
@@ -186,7 +186,7 @@ _gtk_quartz_get_selection_data_from_pasteboard (NSPasteboard *pasteboard,
selection_data->display = gdk_display_get_default ();
if (target == gdk_atom_intern_static_string ("UTF8_STRING"))
{
NSString *s = [pasteboard stringForType:GDK_QUARTZ_STRING_PBOARD_TYPE];
NSString *s = [pasteboard stringForType:NSStringPboardType];
if (s)
{
@@ -237,8 +237,7 @@ _gtk_quartz_get_selection_data_from_pasteboard (NSPasteboard *pasteboard,
gtk_selection_data_set_uris (selection_data, uris);
g_free (uris);
}
else if ([[pasteboard types] containsObject:GDK_QUARTZ_URL_PBOARD_TYPE] ||
[[pasteboard types] containsObject:GDK_QUARTZ_FILE_PBOARD_TYPE])
else if ([[pasteboard types] containsObject:NSURLPboardType])
{
gchar *uris[2];
NSURL *url = [NSURL URLFromPasteboard:pasteboard];
@@ -259,7 +258,7 @@ _gtk_quartz_get_selection_data_from_pasteboard (NSPasteboard *pasteboard,
name = gdk_atom_name (target);
if (strcmp (name, "image/tiff") == 0)
data = [pasteboard dataForType:GDK_QUARTZ_TIFF_PBOARD_TYPE];
data = [pasteboard dataForType:NSTIFFPboardType];
else
data = [pasteboard dataForType:[NSString stringWithUTF8String:name]];
@@ -293,10 +292,10 @@ _gtk_quartz_set_selection_data_for_pasteboard (NSPasteboard *pasteboard,
type = gdk_quartz_atom_to_pasteboard_type_libgtk_only (gtk_selection_data_get_target (selection_data));
if ([type isEqualTo:GDK_QUARTZ_STRING_PBOARD_TYPE])
if ([type isEqualTo:NSStringPboardType])
[pasteboard setString:[NSString stringWithUTF8String:(const char *)data]
forType:type];
else if ([type isEqualTo:GDK_QUARTZ_COLOR_PBOARD_TYPE])
else if ([type isEqualTo:NSColorPboardType])
{
guint16 *color = (guint16 *)data;
float red, green, blue, alpha;
@@ -310,7 +309,7 @@ _gtk_quartz_set_selection_data_for_pasteboard (NSPasteboard *pasteboard,
nscolor = [NSColor colorWithDeviceRed:red green:green blue:blue alpha:alpha];
[nscolor writeToPasteboard:pasteboard];
}
else if ([type isEqualTo:GDK_QUARTZ_URL_PBOARD_TYPE])
else if ([type isEqualTo:NSURLPboardType])
{
gchar **uris;
+1 -1
View File
@@ -241,7 +241,7 @@ gtk_render_arrow (GtkStyleContext *context,
*
* ![](background.png)
*
* Since: 3.0
* Since: 3.0.
**/
void
gtk_render_background (GtkStyleContext *context,
+2 -2
View File
@@ -56,9 +56,9 @@
* @Title: GtkScrolledWindow
* @See_also: #GtkScrollable, #GtkViewport, #GtkAdjustment
*
* GtkScrolledWindow is a container that accepts a single child widget and makes
* GtkScrolledWindow is a container that accepts a single child widget, makes
* that child scrollable using either internally added scrollbars or externally
* associated adjustments.
* associated adjustments, and optionally draws a frame around the child.
*
* Widgets with native scrolling support, i.e. those whose classes implement the
* #GtkScrollable interface, are added directly. For other types of widget, the
+25 -96
View File
@@ -34,14 +34,12 @@
#include "gtksearchenginetracker3.h"
#define N_RESULT_BATCH_ITEMS 50
#define MINER_FS_BUS_NAME "org.freedesktop.Tracker3.Miner.Files"
#define SEARCH_QUERY_BASE(__PATTERN__) \
"SELECT ?url " \
" nfo:fileName(?urn) " \
" nie:mimeType(?ie)" \
" nie:mimeType(?urn)" \
" nfo:fileSize(?urn)" \
" nfo:fileLastModified(?urn)" \
"FROM tracker:FileSystem " \
@@ -49,13 +47,12 @@
" ?urn a nfo:FileDataObject ;" \
" nie:url ?url ; " \
" fts:match ~match . " \
" OPTIONAL { ?urn nie:interpretedAs ?ie } ." \
__PATTERN__ \
"} " \
"ORDER BY ASC(?url)"
"ORDER BY DESC(fts:rank(?urn)) DESC(?url)"
#define SEARCH_QUERY SEARCH_QUERY_BASE("")
#define SEARCH_RECURSIVE_QUERY SEARCH_QUERY_BASE("FILTER (STRSTARTS (?url, CONCAT (~location, '/')))")
#define SEARCH_RECURSIVE_QUERY SEARCH_QUERY_BASE("?urn (nfo:belongsToContainer/nie:isStoredAs)+/nie:url ~location")
#define SEARCH_LOCATION_QUERY SEARCH_QUERY_BASE("?urn nfo:belongsToContainer/nie:isStoredAs/nie:url ~location")
#define FILE_CHECK_QUERY "ASK { ?urn nie:url ~url }"
@@ -68,7 +65,6 @@ struct _GtkSearchEngineTracker3
TrackerSparqlStatement *search_location_query;
TrackerSparqlStatement *file_check_query;
GCancellable *cancellable;
guint idle_id;
GtkQuery *query;
gboolean query_pending;
};
@@ -78,13 +74,6 @@ struct _GtkSearchEngineTracker3Class
GtkSearchEngineClass parent_class;
};
typedef struct
{
TrackerSparqlCursor *cursor;
GtkSearchEngineTracker3 *engine;
gboolean got_results;
} CursorData;
static void gtk_search_engine_tracker3_initable_iface_init (GInitableIface *iface);
G_DEFINE_TYPE_WITH_CODE (GtkSearchEngineTracker3,
@@ -108,8 +97,6 @@ finalize (GObject *object)
g_object_unref (engine->cancellable);
}
g_clear_handle_id (&engine->idle_id, g_source_remove);
g_clear_object (&engine->search_query);
g_clear_object (&engine->search_location_query);
g_clear_object (&engine->file_check_query);
@@ -146,18 +133,7 @@ create_file_info (TrackerSparqlCursor *cursor)
str = tracker_sparql_cursor_get_string (cursor, 2, NULL);
if (str)
{
g_file_info_set_content_type (info, str);
g_file_info_set_attribute_uint32 (info, "standard::type",
strcmp (str, "inode/directory") == 0 ?
G_FILE_TYPE_DIRECTORY :
G_FILE_TYPE_REGULAR);
}
else
{
g_file_info_set_content_type (info, "application/text");
g_file_info_set_attribute_uint32 (info, "standard::type", G_FILE_TYPE_UNKNOWN);
}
g_file_info_set_content_type (info, str);
g_file_info_set_size (info,
tracker_sparql_cursor_get_integer (cursor, 3));
@@ -173,59 +149,6 @@ create_file_info (TrackerSparqlCursor *cursor)
return info;
}
static gboolean
handle_cursor_idle_cb (gpointer user_data)
{
CursorData *data = user_data;
GtkSearchEngineTracker3 *engine = data->engine;
TrackerSparqlCursor *cursor = data->cursor;
gboolean has_next;
GList *hits = NULL;
GtkSearchHit *hit;
int i = 0;
for (i = 0; i < N_RESULT_BATCH_ITEMS; i++)
{
const gchar *url;
has_next = tracker_sparql_cursor_next (cursor, NULL, NULL);
if (!has_next)
break;
url = tracker_sparql_cursor_get_string (cursor, 0, NULL);
hit = g_slice_new0 (GtkSearchHit);
hit->file = g_file_new_for_uri (url);
hit->info = create_file_info (cursor);
hits = g_list_prepend (hits, hit);
data->got_results = TRUE;
}
_gtk_search_engine_hits_added (GTK_SEARCH_ENGINE (engine), hits);
g_list_free_full (hits, free_hit);
if (has_next)
return G_SOURCE_CONTINUE;
else
{
engine->idle_id = 0;
return G_SOURCE_REMOVE;
}
}
static void
cursor_data_free (gpointer user_data)
{
CursorData *data = user_data;
tracker_sparql_cursor_close (data->cursor);
_gtk_search_engine_finished (GTK_SEARCH_ENGINE (data->engine),
data->got_results);
g_object_unref (data->cursor);
g_object_unref (data->engine);
g_free (data);
}
static void
query_callback (TrackerSparqlStatement *statement,
GAsyncResult *res,
@@ -233,8 +156,9 @@ query_callback (TrackerSparqlStatement *statement,
{
GtkSearchEngineTracker3 *engine;
TrackerSparqlCursor *cursor;
GList *hits = NULL;
GError *error = NULL;
CursorData *data;
GtkSearchHit *hit;
engine = GTK_SEARCH_ENGINE_TRACKER3 (user_data);
@@ -250,14 +174,25 @@ query_callback (TrackerSparqlStatement *statement,
return;
}
data = g_new0 (CursorData, 1);
data->cursor = cursor;
data->engine = engine;
while (tracker_sparql_cursor_next (cursor, NULL, NULL))
{
const gchar *url;
engine->idle_id =
g_idle_add_full (G_PRIORITY_DEFAULT_IDLE,
handle_cursor_idle_cb,
data, cursor_data_free);
url = tracker_sparql_cursor_get_string (cursor, 0, NULL);
hit = g_slice_new0 (GtkSearchHit);
hit->file = g_file_new_for_uri (url);
hit->info = create_file_info (cursor);
hits = g_list_prepend (hits, hit);
}
tracker_sparql_cursor_close (cursor);
_gtk_search_engine_hits_added (GTK_SEARCH_ENGINE (engine), hits);
_gtk_search_engine_finished (GTK_SEARCH_ENGINE (engine), hits != NULL);
g_list_free_full (hits, free_hit);
g_object_unref (engine);
g_object_unref (cursor);
}
static void
@@ -284,15 +219,11 @@ gtk_search_engine_tracker3_start (GtkSearchEngine *engine)
return;
}
tracker->query_pending = TRUE;
search_text = gtk_query_get_text (tracker->query);
location = gtk_query_get_location (tracker->query);
recursive = _gtk_search_engine_get_recursive (engine);
if (strlen (search_text) <= 1)
return;
tracker->query_pending = TRUE;
if (location)
{
gchar *location_uri = g_file_get_uri (location);
@@ -340,8 +271,6 @@ gtk_search_engine_tracker3_stop (GtkSearchEngine *engine)
g_cancellable_cancel (tracker->cancellable);
tracker->query_pending = FALSE;
}
g_clear_handle_id (&tracker->idle_id, g_source_remove);
}
static void
-1
View File
@@ -880,7 +880,6 @@ gtk_tooltip_position (GtkTooltip *tooltip,
int anchor_rect_padding;
gtk_widget_realize (GTK_WIDGET (tooltip->current_window));
gtk_window_move_resize (tooltip->current_window);
window = _gtk_widget_get_window (GTK_WIDGET (tooltip->current_window));
tooltip->tooltip_widget = new_tooltip_widget;
+1 -25
View File
@@ -1031,31 +1031,7 @@ libgtk_dep = declare_dependency(sources: gtk_dep_sources,
link_with: libgtk,
link_args: common_ldflags)
foreach lang : [
'bn',
'de',
'da',
'fr',
'es',
'et',
'fi',
'hi',
'hu',
'it',
'ja',
'ko',
'lt',
'ms',
'nb',
'nl',
'pl',
'pt',
'ru',
'sv',
'th',
'uk',
'zh'
]
foreach lang : [ 'de', 'fr', 'es', 'zh' ]
conf = configuration_data()
conf.set('lang', lang)
resxml = configure_file(input: 'emoji/gresource.xml.in',
+1 -1
View File
@@ -75,7 +75,7 @@ static GStatBuf cache_dir_stat;
static gboolean cache_up_to_date;
static int check_dir_mtime (const char *dir,
const struct stat *sb,
const GStatBuf *sb,
int tf)
{
if (tf != FTW_NS && sb->st_mtime > cache_dir_stat.st_mtime)
+2 -6
View File
@@ -1,5 +1,5 @@
project('gtk+', 'c',
version: '3.24.42',
version: '3.24.38',
default_options: [
'buildtype=debugoptimized',
'warning_level=1'
@@ -542,7 +542,6 @@ if wayland_enabled
backend_immodules += ['wayland']
cdata.set('HAVE_XDG_ACTIVATION', wlprotocolsdep.version().version_compare('>=1.21'))
cdata.set('HAVE_TOPLEVEL_STATE_SUSPENDED', wlprotocolsdep.version().version_compare('>=1.32'))
wayland_pkgs = [
'wayland-client', wayland_req,
@@ -833,10 +832,7 @@ endif
profiler_enabled = get_option('profiler')
if profiler_enabled
profiler_dep = dependency('sysprof-capture-3', static: true, required: false)
if not profiler_dep.found()
profiler_dep = dependency('sysprof-capture-4', static: true, required: false)
endif
profiler_dep = dependency('sysprof-capture-3', static: true, required: true)
if profiler_dep.found()
cdata.set('HAVE_SYSPROF_CAPTURE', profiler_dep.found())
else
-3
View File
@@ -336,9 +336,6 @@ gtk_im_context_ime_filter_keypress (GtkIMContext *context,
return FALSE;
utf8 = g_utf16_to_utf8 (event_priv->translation, event_priv->translation_len, NULL, NULL, NULL);
if (!utf8)
return FALSE;
g_signal_emit_by_name (context_ime, "commit", utf8);
g_free (utf8);
@@ -3690,19 +3690,6 @@ avahi_request_printer_list (GtkPrintBackendCups *cups_backend)
g_bus_get (G_BUS_TYPE_SYSTEM, cups_backend->avahi_cancellable, avahi_create_browsers, cups_backend);
}
/*
* Print backend can be disposed together with all its printers
* as a reaction to user stopping enumeration of printers.
*/
static void
backend_finalized_cb (gpointer data,
GObject *where_the_object_was)
{
gboolean *backend_finalized = data;
*backend_finalized = TRUE;
}
static void
cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
GtkCupsResult *result,
@@ -3715,7 +3702,6 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
GList *removed_printer_checklist;
gchar *remote_default_printer = NULL;
GList *iter;
gboolean backend_finalized = FALSE;
gdk_threads_enter ();
@@ -3752,8 +3738,6 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
*/
removed_printer_checklist = gtk_print_backend_get_printer_list (backend);
g_object_weak_ref (G_OBJECT (backend), backend_finalized_cb, &backend_finalized);
response = gtk_cups_result_get_response (result);
for (attr = ippFirstAttribute (response); attr != NULL;
attr = ippNextAttribute (response))
@@ -3864,9 +3848,6 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
{
g_signal_emit_by_name (backend, "printer-added", printer);
if (backend_finalized)
break;
gtk_printer_set_is_new (printer, FALSE);
}
@@ -3903,45 +3884,37 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
break;
}
if (!backend_finalized)
/* look at the removed printers checklist and mark any printer
as inactive if it is in the list, emitting a printer_removed signal */
if (removed_printer_checklist != NULL)
{
g_object_weak_unref (G_OBJECT (backend), backend_finalized_cb, &backend_finalized);
/* look at the removed printers checklist and mark any printer
as inactive if it is in the list, emitting a printer_removed signal */
if (removed_printer_checklist != NULL)
for (iter = removed_printer_checklist; iter; iter = iter->next)
{
for (iter = removed_printer_checklist; iter; iter = iter->next)
if (!GTK_PRINTER_CUPS (iter->data)->avahi_browsed)
{
if (!GTK_PRINTER_CUPS (iter->data)->avahi_browsed)
{
mark_printer_inactive (GTK_PRINTER (iter->data), backend);
list_has_changed = TRUE;
}
mark_printer_inactive (GTK_PRINTER (iter->data), backend);
list_has_changed = TRUE;
}
}
}
g_list_free (removed_printer_checklist);
g_list_free (removed_printer_checklist);
}
done:
if (!backend_finalized)
if (list_has_changed)
g_signal_emit_by_name (backend, "printer-list-changed");
gtk_print_backend_set_list_done (backend);
if (!cups_backend->got_default_printer && remote_default_printer != NULL)
{
if (list_has_changed)
g_signal_emit_by_name (backend, "printer-list-changed");
gtk_print_backend_set_list_done (backend);
if (!cups_backend->got_default_printer && remote_default_printer != NULL)
{
set_default_printer (cups_backend, remote_default_printer);
g_free (remote_default_printer);
}
if (!cups_backend->got_default_printer && cups_backend->avahi_default_printer != NULL)
set_default_printer (cups_backend, cups_backend->avahi_default_printer);
set_default_printer (cups_backend, remote_default_printer);
g_free (remote_default_printer);
}
if (!cups_backend->got_default_printer && cups_backend->avahi_default_printer != NULL)
set_default_printer (cups_backend, cups_backend->avahi_default_printer);
gdk_threads_leave ();
}
-1
View File
@@ -61,7 +61,6 @@ is
it
ja
ka
kab
kg
kk
km
+1868 -1692
View File
File diff suppressed because it is too large Load Diff
+586 -581
View File
File diff suppressed because it is too large Load Diff
+1198 -667
View File
File diff suppressed because it is too large Load Diff
+9913 -8375
View File
File diff suppressed because it is too large Load Diff
+1981 -2296
View File
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More