Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 459e0f2ccf |
@@ -160,7 +160,7 @@ endif
|
||||
|
||||
ld = find_program('ld', required : false)
|
||||
|
||||
if not meson.is_cross_build() and build_machine.cpu_family() != 'arm' and build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_add_symbol and ld.found()
|
||||
if build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_add_symbol and ld.found()
|
||||
glib_compile_resources = find_program('glib-compile-resources')
|
||||
|
||||
# Create the resource blob
|
||||
|
||||
@@ -8,7 +8,7 @@ endif
|
||||
|
||||
ld = find_program('ld', required : false)
|
||||
|
||||
if not meson.is_cross_build() and build_machine.cpu_family() != 'arm' and build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_add_symbol and ld.found()
|
||||
if build_machine.system() == 'linux' and objcopy.found() and objcopy_supports_add_symbol and ld.found()
|
||||
glib_compile_resources = find_program('glib-compile-resources')
|
||||
|
||||
# Create the resource blob
|
||||
|
||||
@@ -372,7 +372,7 @@ library you are using:
|
||||
The `test` accessibility backend is recommended for test suites and remote
|
||||
continuous integration pipelines.
|
||||
|
||||
### `XDG_DATA_HOME`, `XDG_DATA_DIRS`
|
||||
### `XDG_DTA_HOME`, `XDG_DATA_DIRS`
|
||||
|
||||
GTK uses these environment variables to locate icon themes
|
||||
and MIME information. For more information, see the
|
||||
|
||||
@@ -1721,6 +1721,8 @@ gdk_display_init_egl (GdkDisplay *self,
|
||||
|
||||
self->have_egl_buffer_age =
|
||||
epoxy_has_egl_extension (priv->egl_display, "EGL_EXT_buffer_age");
|
||||
self->have_egl_swap_buffers_with_damage =
|
||||
epoxy_has_egl_extension (priv->egl_display, "EGL_EXT_swap_buffers_with_damage");
|
||||
self->have_egl_no_config_context =
|
||||
epoxy_has_egl_extension (priv->egl_display, "EGL_KHR_no_config_context");
|
||||
self->have_egl_pixel_format_float =
|
||||
|
||||
@@ -107,6 +107,7 @@ struct _GdkDisplay
|
||||
|
||||
/* egl info */
|
||||
guint have_egl_buffer_age : 1;
|
||||
guint have_egl_swap_buffers_with_damage : 1;
|
||||
guint have_egl_no_config_context : 1;
|
||||
guint have_egl_pixel_format_float : 1;
|
||||
guint have_egl_win32_libangle : 1;
|
||||
|
||||
@@ -117,7 +117,6 @@ typedef struct {
|
||||
|
||||
#ifdef HAVE_EGL
|
||||
EGLContext egl_context;
|
||||
EGLBoolean (*eglSwapBuffersWithDamage) (EGLDisplay, EGLSurface, const EGLint *, EGLint);
|
||||
#endif
|
||||
} GdkGLContextPrivate;
|
||||
|
||||
@@ -421,11 +420,6 @@ gdk_gl_context_real_realize (GdkGLContext *context,
|
||||
|
||||
gdk_gl_context_set_is_legacy (context, legacy_bit);
|
||||
|
||||
if (epoxy_has_egl_extension (egl_display, "EGL_KHR_swap_buffers_with_damage"))
|
||||
priv->eglSwapBuffersWithDamage = (gpointer)epoxy_eglGetProcAddress ("eglSwapBuffersWithDamageKHR");
|
||||
else if (epoxy_has_egl_extension (egl_display, "EGL_EXT_swap_buffers_with_damage"))
|
||||
priv->eglSwapBuffersWithDamage = (gpointer)epoxy_eglGetProcAddress ("eglSwapBuffersWithDamageEXT");
|
||||
|
||||
gdk_profiler_end_mark (start_time, "realize GdkWaylandGLContext", NULL);
|
||||
|
||||
return api;
|
||||
@@ -614,7 +608,7 @@ gdk_gl_context_real_end_frame (GdkDrawContext *draw_context,
|
||||
|
||||
gdk_profiler_add_mark (GDK_PROFILER_CURRENT_TIME, 0, "EGL", "swap buffers");
|
||||
|
||||
if (priv->eglSwapBuffersWithDamage)
|
||||
if (display->have_egl_swap_buffers_with_damage)
|
||||
{
|
||||
EGLint stack_rects[4 * 4]; /* 4 rects */
|
||||
EGLint *heap_rects = NULL;
|
||||
@@ -638,7 +632,7 @@ gdk_gl_context_real_end_frame (GdkDrawContext *draw_context,
|
||||
rects[j++] = rect.width * scale;
|
||||
rects[j++] = rect.height * scale;
|
||||
}
|
||||
priv->eglSwapBuffersWithDamage (gdk_display_get_egl_display (display), egl_surface, rects, n_rects);
|
||||
eglSwapBuffersWithDamageEXT (gdk_display_get_egl_display (display), egl_surface, rects, n_rects);
|
||||
g_free (heap_rects);
|
||||
}
|
||||
else
|
||||
|
||||
@@ -25,6 +25,10 @@
|
||||
|
||||
#include <epoxy/gl.h>
|
||||
|
||||
#ifdef __ARM_NEON
|
||||
#include <arm_neon.h>
|
||||
#endif
|
||||
|
||||
typedef struct _GdkMemoryFormatDescription GdkMemoryFormatDescription;
|
||||
|
||||
#define TYPED_FUNCS(name, T, R, G, B, A, bpp, scale) \
|
||||
@@ -166,54 +170,75 @@ r32g32b32a32_float_from_float (guchar *dest,
|
||||
memcpy (dest, src, sizeof (float) * n * 4);
|
||||
}
|
||||
|
||||
#define PREMULTIPLY_FUNC(name, R1, G1, B1, A1, R2, G2, B2, A2) \
|
||||
static void \
|
||||
name (guchar *dest, \
|
||||
const guchar *src, \
|
||||
gsize n) \
|
||||
{ \
|
||||
for (; n > 0; n--) \
|
||||
{ \
|
||||
guchar a = src[A1]; \
|
||||
guint16 r = (guint16)src[R1] * a + 127; \
|
||||
guint16 g = (guint16)src[G1] * a + 127; \
|
||||
guint16 b = (guint16)src[B1] * a + 127; \
|
||||
dest[R2] = (r + (r >> 8) + 1) >> 8; \
|
||||
dest[G2] = (g + (g >> 8) + 1) >> 8; \
|
||||
dest[B2] = (b + (b >> 8) + 1) >> 8; \
|
||||
dest[A2] = a; \
|
||||
dest += 4; \
|
||||
src += 4; \
|
||||
} \
|
||||
// This one conversion is quite important, it converts from RGBA with straight
|
||||
// alpha (as found in PNG for instance) to BGRA with premultiplied alpha (the
|
||||
// sole cairo format available).
|
||||
static void
|
||||
r8g8b8a8_to_b8g8r8a8_premultiplied (guchar *dest,
|
||||
const guchar *src,
|
||||
gsize n)
|
||||
{
|
||||
#ifdef __ARM_NEON
|
||||
uint16x8_t one = vdupq_n_u16 (1);
|
||||
uint16x8_t half = vdupq_n_u16 (127);
|
||||
|
||||
for (gsize i = n / 8; i > 0; i--)
|
||||
{
|
||||
// Work on “just” 8 pixels at once, since we need the full 16-bytes of
|
||||
// the q registers for the multiplication.
|
||||
uint8x8x4_t rgba = vld4_u8 (src);
|
||||
uint8x8_t r8 = rgba.val[0];
|
||||
uint8x8_t g8 = rgba.val[1];
|
||||
uint8x8_t b8 = rgba.val[2];
|
||||
uint8x8_t a8 = rgba.val[3];
|
||||
|
||||
// This is the same algorithm as premultiply(), but on packed 16-bit
|
||||
// instead of float.
|
||||
uint16x8_t r16 = vmull_u8 (r8, a8);
|
||||
uint16x8_t g16 = vmull_u8 (g8, a8);
|
||||
uint16x8_t b16 = vmull_u8 (b8, a8);
|
||||
|
||||
r16 = vaddq_u16 (r16, half);
|
||||
g16 = vaddq_u16 (g16, half);
|
||||
b16 = vaddq_u16 (b16, half);
|
||||
|
||||
r16 = vsraq_n_u16 (r16, r16, 8);
|
||||
g16 = vsraq_n_u16 (g16, g16, 8);
|
||||
b16 = vsraq_n_u16 (b16, b16, 8);
|
||||
|
||||
r16 = vaddq_u16 (r16, one);
|
||||
g16 = vaddq_u16 (g16, one);
|
||||
b16 = vaddq_u16 (b16, one);
|
||||
|
||||
// Just like the other one, here we use BGRA instead of RGBA!
|
||||
rgba.val[0] = vshrn_n_u16 (b16, 8);
|
||||
rgba.val[1] = vshrn_n_u16 (g16, 8);
|
||||
rgba.val[2] = vshrn_n_u16 (r16, 8);
|
||||
|
||||
vst4_u8 (dest, rgba);
|
||||
src += 32;
|
||||
dest += 32;
|
||||
}
|
||||
|
||||
// We want the fallthrough here for the last (up to) seven bytes of the row.
|
||||
n = n % 8;
|
||||
#endif // __ARM_NEON
|
||||
|
||||
for (; n > 0; n--)
|
||||
{
|
||||
guchar a = src[3];
|
||||
guint16 r = (guint16)src[0] * a + 127;
|
||||
guint16 g = (guint16)src[1] * a + 127;
|
||||
guint16 b = (guint16)src[2] * a + 127;
|
||||
dest[0] = (b + (b >> 8) + 1) >> 8;
|
||||
dest[1] = (g + (g >> 8) + 1) >> 8;
|
||||
dest[2] = (r + (r >> 8) + 1) >> 8;
|
||||
dest[3] = a;
|
||||
dest += 4;
|
||||
src += 4;
|
||||
}
|
||||
}
|
||||
|
||||
PREMULTIPLY_FUNC(r8g8b8a8_to_r8g8b8a8_premultiplied, 0, 1, 2, 3, 0, 1, 2, 3)
|
||||
PREMULTIPLY_FUNC(r8g8b8a8_to_b8g8r8a8_premultiplied, 0, 1, 2, 3, 2, 1, 0, 3)
|
||||
PREMULTIPLY_FUNC(r8g8b8a8_to_a8r8g8b8_premultiplied, 0, 1, 2, 3, 1, 2, 3, 0)
|
||||
PREMULTIPLY_FUNC(r8g8b8a8_to_a8b8g8r8_premultiplied, 0, 1, 2, 3, 3, 2, 1, 0)
|
||||
|
||||
#define ADD_ALPHA_FUNC(name, R1, G1, B1, R2, G2, B2, A2) \
|
||||
static void \
|
||||
name (guchar *dest, \
|
||||
const guchar *src, \
|
||||
gsize n) \
|
||||
{ \
|
||||
for (; n > 0; n--) \
|
||||
{ \
|
||||
dest[R2] = src[R1]; \
|
||||
dest[G2] = src[G1]; \
|
||||
dest[B2] = src[B1]; \
|
||||
dest[A2] = 255; \
|
||||
dest += 4; \
|
||||
src += 3; \
|
||||
} \
|
||||
}
|
||||
|
||||
ADD_ALPHA_FUNC(r8g8b8_to_r8g8b8a8, 0, 1, 2, 0, 1, 2, 3)
|
||||
ADD_ALPHA_FUNC(r8g8b8_to_b8g8r8a8, 0, 1, 2, 2, 1, 0, 3)
|
||||
ADD_ALPHA_FUNC(r8g8b8_to_a8r8g8b8, 0, 1, 2, 1, 2, 3, 0)
|
||||
ADD_ALPHA_FUNC(r8g8b8_to_a8b8g8r8, 0, 1, 2, 3, 2, 1, 0)
|
||||
|
||||
struct _GdkMemoryFormatDescription
|
||||
{
|
||||
GdkMemoryAlpha alpha;
|
||||
@@ -523,53 +548,15 @@ gdk_memory_convert (guchar *dest_data,
|
||||
const GdkMemoryFormatDescription *src_desc = &memory_formats[src_format];
|
||||
float *tmp;
|
||||
gsize y;
|
||||
void (*func) (guchar *, const guchar *, gsize) = NULL;
|
||||
|
||||
g_assert (dest_format < GDK_MEMORY_N_FORMATS);
|
||||
g_assert (src_format < GDK_MEMORY_N_FORMATS);
|
||||
|
||||
if (src_format == GDK_MEMORY_R8G8B8A8 && dest_format == GDK_MEMORY_R8G8B8A8_PREMULTIPLIED)
|
||||
func = r8g8b8a8_to_r8g8b8a8_premultiplied;
|
||||
else if (src_format == GDK_MEMORY_B8G8R8A8 && dest_format == GDK_MEMORY_R8G8B8A8_PREMULTIPLIED)
|
||||
func = r8g8b8a8_to_b8g8r8a8_premultiplied;
|
||||
else if (src_format == GDK_MEMORY_R8G8B8A8 && dest_format == GDK_MEMORY_B8G8R8A8_PREMULTIPLIED)
|
||||
func = r8g8b8a8_to_b8g8r8a8_premultiplied;
|
||||
else if (src_format == GDK_MEMORY_B8G8R8A8 && dest_format == GDK_MEMORY_B8G8R8A8_PREMULTIPLIED)
|
||||
func = r8g8b8a8_to_r8g8b8a8_premultiplied;
|
||||
else if (src_format == GDK_MEMORY_R8G8B8A8 && dest_format == GDK_MEMORY_A8R8G8B8_PREMULTIPLIED)
|
||||
func = r8g8b8a8_to_a8r8g8b8_premultiplied;
|
||||
else if (src_format == GDK_MEMORY_B8G8R8A8 && dest_format == GDK_MEMORY_A8R8G8B8_PREMULTIPLIED)
|
||||
func = r8g8b8a8_to_a8b8g8r8_premultiplied;
|
||||
else if (src_format == GDK_MEMORY_R8G8B8 && dest_format == GDK_MEMORY_R8G8B8A8_PREMULTIPLIED)
|
||||
func = r8g8b8_to_r8g8b8a8;
|
||||
else if (src_format == GDK_MEMORY_B8G8R8 && dest_format == GDK_MEMORY_R8G8B8A8_PREMULTIPLIED)
|
||||
func = r8g8b8_to_b8g8r8a8;
|
||||
else if (src_format == GDK_MEMORY_R8G8B8 && dest_format == GDK_MEMORY_B8G8R8A8_PREMULTIPLIED)
|
||||
func = r8g8b8_to_b8g8r8a8;
|
||||
else if (src_format == GDK_MEMORY_B8G8R8 && dest_format == GDK_MEMORY_B8G8R8A8_PREMULTIPLIED)
|
||||
func = r8g8b8_to_r8g8b8a8;
|
||||
else if (src_format == GDK_MEMORY_R8G8B8 && dest_format == GDK_MEMORY_A8R8G8B8_PREMULTIPLIED)
|
||||
func = r8g8b8_to_a8r8g8b8;
|
||||
else if (src_format == GDK_MEMORY_B8G8R8 && dest_format == GDK_MEMORY_A8R8G8B8_PREMULTIPLIED)
|
||||
func = r8g8b8_to_a8b8g8r8;
|
||||
else if (src_format == GDK_MEMORY_R8G8B8 && dest_format == GDK_MEMORY_R8G8B8A8)
|
||||
func = r8g8b8_to_r8g8b8a8;
|
||||
else if (src_format == GDK_MEMORY_B8G8R8 && dest_format == GDK_MEMORY_R8G8B8A8)
|
||||
func = r8g8b8_to_b8g8r8a8;
|
||||
else if (src_format == GDK_MEMORY_R8G8B8 && dest_format == GDK_MEMORY_B8G8R8A8)
|
||||
func = r8g8b8_to_b8g8r8a8;
|
||||
else if (src_format == GDK_MEMORY_B8G8R8 && dest_format == GDK_MEMORY_B8G8R8A8)
|
||||
func = r8g8b8_to_r8g8b8a8;
|
||||
else if (src_format == GDK_MEMORY_R8G8B8 && dest_format == GDK_MEMORY_A8R8G8B8)
|
||||
func = r8g8b8_to_a8r8g8b8;
|
||||
else if (src_format == GDK_MEMORY_B8G8R8 && dest_format == GDK_MEMORY_A8R8G8B8)
|
||||
func = r8g8b8_to_a8b8g8r8;
|
||||
|
||||
if (func != NULL)
|
||||
if (src_format == GDK_MEMORY_R8G8B8A8 && dest_format == GDK_MEMORY_B8G8R8A8_PREMULTIPLIED)
|
||||
{
|
||||
for (y = 0; y < height; y++)
|
||||
{
|
||||
func (dest_data, src_data, width);
|
||||
r8g8b8a8_to_b8g8r8a8_premultiplied (dest_data, src_data, width);
|
||||
src_data += src_stride;
|
||||
dest_data += dest_stride;
|
||||
}
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
|
||||
#import "GdkMacosLayer.h"
|
||||
#import "GdkMacosView.h"
|
||||
#import "GdkMacosWindow.h"
|
||||
|
||||
@implementation GdkMacosView
|
||||
|
||||
@@ -57,19 +56,6 @@
|
||||
return NO;
|
||||
}
|
||||
|
||||
-(void)mouseDown:(NSEvent *)nsevent
|
||||
{
|
||||
if ([(GdkMacosWindow *)[self window] needsMouseDownQuirk])
|
||||
/* We should only hit this when we are trying to click through
|
||||
* the shadow of a window into another window. Just request
|
||||
* that the application not activate this window on mouseUp.
|
||||
* See gdkmacosdisplay-translate.c for the other half of this.
|
||||
*/
|
||||
[NSApp preventWindowOrdering];
|
||||
else
|
||||
[super mouseDown:nsevent];
|
||||
}
|
||||
|
||||
-(void)setFrame:(NSRect)rect
|
||||
{
|
||||
[super setFrame:rect];
|
||||
|
||||
@@ -253,8 +253,7 @@ typedef NSString *CALayerContentsGravity;
|
||||
|
||||
-(BOOL)canBecomeKeyWindow
|
||||
{
|
||||
return GDK_IS_TOPLEVEL (gdk_surface) ||
|
||||
(GDK_IS_POPUP (gdk_surface) && GDK_SURFACE (gdk_surface)->input_region != NULL);
|
||||
return GDK_IS_TOPLEVEL (gdk_surface) || GDK_IS_POPUP (gdk_surface);
|
||||
}
|
||||
|
||||
-(void)showAndMakeKey:(BOOL)makeKey
|
||||
@@ -262,12 +261,9 @@ typedef NSString *CALayerContentsGravity;
|
||||
inShowOrHide = YES;
|
||||
|
||||
if (makeKey && [self canBecomeKeyWindow])
|
||||
[self makeKeyAndOrderFront:self];
|
||||
[self makeKeyAndOrderFront:nil];
|
||||
else
|
||||
[self orderFront:self];
|
||||
|
||||
if (makeKey && [self canBecomeMainWindow])
|
||||
[self makeMainWindow];
|
||||
[self orderFront:nil];
|
||||
|
||||
inShowOrHide = NO;
|
||||
|
||||
@@ -377,17 +373,9 @@ typedef NSString *CALayerContentsGravity;
|
||||
_gdk_macos_surface_configure ([self gdkSurface]);
|
||||
}
|
||||
|
||||
-(void)windowDidResize:(NSNotification *)notification
|
||||
- (void)windowDidResize:(NSNotification *)notification
|
||||
{
|
||||
_gdk_macos_surface_configure (gdk_surface);
|
||||
|
||||
/* If we're using server-side decorations, this notification is coming
|
||||
* in from a display-side change. We need to request a layout in
|
||||
* addition to the configure event.
|
||||
*/
|
||||
if (GDK_IS_MACOS_TOPLEVEL_SURFACE (gdk_surface) &&
|
||||
GDK_MACOS_TOPLEVEL_SURFACE (gdk_surface)->decorated)
|
||||
gdk_surface_request_layout (GDK_SURFACE (gdk_surface));
|
||||
_gdk_macos_surface_configure ([self gdkSurface]);
|
||||
}
|
||||
|
||||
/* Used by gdkmacosdisplay-translate.c to decide if our sendEvent() handler
|
||||
@@ -830,10 +818,4 @@ typedef NSString *CALayerContentsGravity;
|
||||
[(GdkMacosView *)[self contentView] swapBuffer:buffer withDamage:damage];
|
||||
}
|
||||
|
||||
-(BOOL)needsMouseDownQuirk
|
||||
{
|
||||
return GDK_IS_MACOS_TOPLEVEL_SURFACE (gdk_surface) &&
|
||||
!GDK_MACOS_TOPLEVEL_SURFACE (gdk_surface)->decorated;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -69,6 +69,5 @@
|
||||
-(BOOL)trackManualResize;
|
||||
-(void)setDecorated:(BOOL)decorated;
|
||||
-(void)swapBuffer:(GdkMacosBuffer *)buffer withDamage:(const cairo_region_t *)damage;
|
||||
-(BOOL)needsMouseDownQuirk;
|
||||
|
||||
@end
|
||||
|
||||
@@ -43,8 +43,6 @@ G_BEGIN_DECLS
|
||||
#define GIC_FILTER_PASSTHRU 0
|
||||
#define GIC_FILTER_FILTERED 1
|
||||
|
||||
#define GDK_MACOS_EVENT_DROP (GdkEvent *)GSIZE_TO_POINTER(1)
|
||||
|
||||
struct _GdkMacosDisplay
|
||||
{
|
||||
GdkDisplay parent_instance;
|
||||
@@ -84,14 +82,6 @@ struct _GdkMacosDisplay
|
||||
int min_y;
|
||||
int max_x;
|
||||
int max_y;
|
||||
|
||||
/* A GSource to select a new main/key window */
|
||||
guint select_key_in_idle;
|
||||
|
||||
/* Note if we have a key window that is not a GdkMacosWindow
|
||||
* such as a NSPanel used for native dialogs.
|
||||
*/
|
||||
guint key_window_is_foregin : 1;
|
||||
};
|
||||
|
||||
struct _GdkMacosDisplayClass
|
||||
|
||||
@@ -34,7 +34,7 @@ typedef struct
|
||||
const char *font_name;
|
||||
int xft_dpi;
|
||||
int double_click_time;
|
||||
int cursor_blink_time;
|
||||
int cursor_blink_timeout;
|
||||
guint enable_animations : 1;
|
||||
guint shell_shows_desktop : 1;
|
||||
guint shell_shows_menubar : 1;
|
||||
@@ -65,9 +65,9 @@ _gdk_macos_settings_load (GdkMacosSettings *settings)
|
||||
|
||||
ival = [defaults integerForKey:@"NSTextInsertionPointBlinkPeriod"];
|
||||
if (ival > 0)
|
||||
settings->cursor_blink_time = ival;
|
||||
settings->cursor_blink_timeout = ival;
|
||||
else
|
||||
settings->cursor_blink_time = 1000;
|
||||
settings->cursor_blink_timeout = 1000;
|
||||
|
||||
settings->primary_button_warps_slider =
|
||||
[[NSUserDefaults standardUserDefaults] boolForKey:@"AppleScrollerPagingBehavior"] == YES;
|
||||
@@ -124,9 +124,9 @@ _gdk_macos_display_get_setting (GdkMacosDisplay *self,
|
||||
g_value_set_int (value, current_settings.xft_dpi);
|
||||
ret = TRUE;
|
||||
}
|
||||
else if (strcmp (setting, "gtk-cursor-blink-time") == 0)
|
||||
else if (strcmp (setting, "gtk-cursor-blink-timeout") == 0)
|
||||
{
|
||||
g_value_set_int (value, current_settings.cursor_blink_time);
|
||||
g_value_set_int (value, current_settings.cursor_blink_timeout);
|
||||
ret = TRUE;
|
||||
}
|
||||
else if (strcmp (setting, "gtk-double-click-time") == 0)
|
||||
|
||||
@@ -628,7 +628,7 @@ fill_scroll_event (GdkMacosDisplay *self,
|
||||
* handle those internally.
|
||||
*/
|
||||
if (phase == 0 && momentumPhase != 0)
|
||||
return GDK_MACOS_EVENT_DROP;
|
||||
return NULL;
|
||||
|
||||
seat = gdk_display_get_default_seat (GDK_DISPLAY (self));
|
||||
pointer = gdk_seat_get_pointer (seat);
|
||||
@@ -1086,7 +1086,6 @@ _gdk_macos_display_translate (GdkMacosDisplay *self,
|
||||
GdkMacosSurface *surface;
|
||||
GdkMacosWindow *window;
|
||||
NSEventType event_type;
|
||||
NSWindow *event_window;
|
||||
GdkEvent *ret = NULL;
|
||||
int x;
|
||||
int y;
|
||||
@@ -1129,15 +1128,6 @@ _gdk_macos_display_translate (GdkMacosDisplay *self,
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* If the event was delivered to NSWindow that is foreign (or rather,
|
||||
* Cocoa native), then we should pass the event along to that window.
|
||||
*/
|
||||
if ((event_window = [nsevent window]) && !GDK_IS_MACOS_WINDOW (event_window))
|
||||
return NULL;
|
||||
|
||||
/* If we can't find a GdkSurface to deliver the event to, then we
|
||||
* should pass it along to the NSApp.
|
||||
*/
|
||||
if (!(surface = find_surface_for_ns_event (self, nsevent, &x, &y)))
|
||||
return NULL;
|
||||
|
||||
@@ -1169,31 +1159,15 @@ _gdk_macos_display_translate (GdkMacosDisplay *self,
|
||||
if (test_resize (nsevent, surface, x, y))
|
||||
return NULL;
|
||||
|
||||
if (event_type == NSEventTypeRightMouseDown ||
|
||||
event_type == NSEventTypeOtherMouseDown ||
|
||||
event_type == NSEventTypeLeftMouseDown)
|
||||
if ((event_type == NSEventTypeRightMouseDown ||
|
||||
event_type == NSEventTypeOtherMouseDown ||
|
||||
event_type == NSEventTypeLeftMouseDown))
|
||||
{
|
||||
if (![NSApp isActive])
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
|
||||
if (![window isKeyWindow])
|
||||
{
|
||||
NSWindow *orig_window = [nsevent window];
|
||||
|
||||
/* To get NSApp to supress activating the window we might
|
||||
* have clicked through the shadow of, we need to dispatch
|
||||
* the event and handle it in GdkMacosView:mouseDown to call
|
||||
* [NSApp preventWindowOrdering]. Calling it here will not
|
||||
* do anything as the event is not registered.
|
||||
*/
|
||||
if (orig_window &&
|
||||
GDK_IS_MACOS_WINDOW (orig_window) &&
|
||||
[(GdkMacosWindow *)orig_window needsMouseDownQuirk])
|
||||
[NSApp sendEvent:nsevent];
|
||||
|
||||
[window showAndMakeKey:YES];
|
||||
_gdk_macos_display_clear_sorting (self);
|
||||
}
|
||||
[window makeKeyWindow];
|
||||
}
|
||||
|
||||
switch ((int)event_type)
|
||||
@@ -1226,11 +1200,7 @@ _gdk_macos_display_translate (GdkMacosDisplay *self,
|
||||
GdkDevice *pointer = gdk_seat_get_pointer (seat);
|
||||
GdkDeviceGrabInfo *grab = _gdk_display_get_last_device_grab (GDK_DISPLAY (self), pointer);
|
||||
|
||||
if ([(GdkMacosWindow *)window isInManualResizeOrMove])
|
||||
{
|
||||
ret = GDK_MACOS_EVENT_DROP;
|
||||
}
|
||||
else if (grab == NULL)
|
||||
if (grab == NULL)
|
||||
{
|
||||
if (event_type == NSEventTypeMouseExited)
|
||||
[[NSCursor arrowCursor] set];
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include "config.h"
|
||||
|
||||
#include "gdkmacosdisplay-private.h"
|
||||
#include "gdkmacosmonitor-private.h"
|
||||
#include "gdkmacosmonitor.h"
|
||||
#include "gdkmacossurface-private.h"
|
||||
#include "gdkmacostoplevelsurface-private.h"
|
||||
|
||||
@@ -36,28 +36,47 @@ _gdk_macos_display_position_toplevel_with_parent (GdkMacosDisplay *self,
|
||||
{
|
||||
GdkRectangle surface_rect;
|
||||
GdkRectangle parent_rect;
|
||||
GdkRectangle workarea;
|
||||
GdkMonitor *monitor;
|
||||
|
||||
g_assert (GDK_IS_MACOS_DISPLAY (self));
|
||||
g_assert (GDK_IS_MACOS_TOPLEVEL_SURFACE (surface));
|
||||
g_assert (GDK_IS_MACOS_TOPLEVEL_SURFACE (parent));
|
||||
|
||||
monitor = _gdk_macos_surface_get_best_monitor (parent);
|
||||
/* If x/y is set, we should place relative to parent */
|
||||
if (GDK_SURFACE (surface)->x != 0 || GDK_SURFACE (surface)->y != 0)
|
||||
{
|
||||
*x = parent->root_x + GDK_SURFACE (surface)->x;
|
||||
*y = parent->root_y + GDK_SURFACE (surface)->y;
|
||||
return;
|
||||
}
|
||||
|
||||
/* Try to center on top of the parent but also try to make the whole thing
|
||||
* visible in case that lands us under the topbar/panel/etc.
|
||||
*/
|
||||
parent_rect.x = parent->root_x + parent->shadow_left;
|
||||
parent_rect.y = parent->root_y + parent->shadow_top;
|
||||
parent_rect.width = GDK_SURFACE (parent)->width - parent->shadow_left - parent->shadow_right;
|
||||
parent_rect.height = GDK_SURFACE (parent)->height - parent->shadow_top - parent->shadow_bottom;
|
||||
|
||||
surface_rect.x = surface->root_x + surface->shadow_left;
|
||||
surface_rect.y = surface->root_y + surface->shadow_top;
|
||||
surface_rect.width = GDK_SURFACE (surface)->width - surface->shadow_left - surface->shadow_right;
|
||||
surface_rect.height = GDK_SURFACE (surface)->height - surface->shadow_top - surface->shadow_bottom;
|
||||
|
||||
parent_rect.x = parent->root_x + surface->shadow_left;
|
||||
parent_rect.y = parent->root_y + surface->shadow_top;
|
||||
parent_rect.width = GDK_SURFACE (parent)->width - surface->shadow_left - surface->shadow_right;
|
||||
parent_rect.height = GDK_SURFACE (parent)->height - surface->shadow_top - surface->shadow_bottom;
|
||||
|
||||
/* Try to place centered atop parent */
|
||||
surface_rect.x = parent_rect.x + ((parent_rect.width - surface_rect.width) / 2);
|
||||
surface_rect.y = parent_rect.y + ((parent_rect.height - surface_rect.height) / 2);
|
||||
|
||||
_gdk_macos_monitor_clamp (GDK_MACOS_MONITOR (monitor), &surface_rect);
|
||||
/* Now make sure that we don't overlap the top-bar */
|
||||
monitor = _gdk_macos_surface_get_best_monitor (parent);
|
||||
gdk_macos_monitor_get_workarea (monitor, &workarea);
|
||||
|
||||
if (surface_rect.x < workarea.x)
|
||||
surface_rect.x = workarea.x;
|
||||
|
||||
if (surface_rect.y < workarea.y)
|
||||
surface_rect.y = workarea.y;
|
||||
|
||||
*x = surface_rect.x - surface->shadow_left;
|
||||
*y = surface_rect.y - surface->shadow_top;
|
||||
@@ -104,7 +123,11 @@ _gdk_macos_display_position_toplevel (GdkMacosDisplay *self,
|
||||
surface_rect.x = workarea.x + ((workarea.width - surface_rect.width) / 2);
|
||||
surface_rect.y = workarea.y + ((workarea.height - surface_rect.height) / 2);
|
||||
|
||||
_gdk_macos_monitor_clamp (GDK_MACOS_MONITOR (surface->best_monitor), &surface_rect);
|
||||
if (surface_rect.x < workarea.x)
|
||||
surface_rect.x = workarea.x;
|
||||
|
||||
if (surface_rect.y < workarea.y)
|
||||
surface_rect.y = workarea.y;
|
||||
|
||||
*x = surface_rect.x - surface->shadow_left;
|
||||
*y = surface_rect.y - surface->shadow_top;
|
||||
|
||||
@@ -156,10 +156,6 @@ gdk_macos_display_update_bounds (GdkMacosDisplay *self)
|
||||
self->width = self->max_x - self->min_x;
|
||||
self->height = self->max_y - self->min_y;
|
||||
|
||||
GDK_NOTE (MISC,
|
||||
g_message ("Displays reconfigured to bounds %d,%d %dx%d",
|
||||
self->min_x, self->min_y, self->width, self->height));
|
||||
|
||||
GDK_END_MACOS_ALLOC_POOL;
|
||||
}
|
||||
|
||||
@@ -310,15 +306,11 @@ gdk_macos_display_queue_events (GdkDisplay *display)
|
||||
|
||||
g_return_if_fail (GDK_IS_MACOS_DISPLAY (self));
|
||||
|
||||
while ((nsevent = _gdk_macos_event_source_get_pending ()))
|
||||
if ((nsevent = _gdk_macos_event_source_get_pending ()))
|
||||
{
|
||||
GdkEvent *event = _gdk_macos_display_translate (self, nsevent);
|
||||
|
||||
if (event == GDK_MACOS_EVENT_DROP)
|
||||
{
|
||||
[nsevent release];
|
||||
}
|
||||
else if (event != NULL)
|
||||
if (event != NULL)
|
||||
{
|
||||
push_nsevent (event, nsevent);
|
||||
_gdk_windowing_got_event (GDK_DISPLAY (self),
|
||||
@@ -413,38 +405,6 @@ _gdk_macos_display_surface_became_key (GdkMacosDisplay *self,
|
||||
gdk_surface_request_motion (GDK_SURFACE (surface));
|
||||
}
|
||||
|
||||
static gboolean
|
||||
select_key_in_idle_cb (gpointer data)
|
||||
{
|
||||
GdkMacosDisplay *self = data;
|
||||
|
||||
g_assert (GDK_IS_MACOS_DISPLAY (self));
|
||||
|
||||
self->select_key_in_idle = 0;
|
||||
|
||||
/* Don't steal focus from NSPanel, etc */
|
||||
if (self->key_window_is_foregin)
|
||||
return G_SOURCE_REMOVE;
|
||||
|
||||
if (self->keyboard_surface == NULL)
|
||||
{
|
||||
const GList *surfaces = _gdk_macos_display_get_surfaces (self);
|
||||
|
||||
for (const GList *iter = surfaces; iter; iter = iter->next)
|
||||
{
|
||||
GdkMacosSurface *surface = iter->data;
|
||||
|
||||
if (GDK_SURFACE_IS_MAPPED (GDK_SURFACE (surface)))
|
||||
{
|
||||
[surface->window showAndMakeKey:YES];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return G_SOURCE_REMOVE;
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_macos_display_surface_resigned_key (GdkMacosDisplay *self,
|
||||
GdkMacosSurface *surface)
|
||||
@@ -489,9 +449,6 @@ _gdk_macos_display_surface_resigned_key (GdkMacosDisplay *self,
|
||||
}
|
||||
|
||||
_gdk_macos_display_clear_sorting (self);
|
||||
|
||||
if (self->select_key_in_idle == 0)
|
||||
self->select_key_in_idle = g_idle_add (select_key_in_idle_cb, self);
|
||||
}
|
||||
|
||||
/* Raises a transient window.
|
||||
@@ -530,6 +487,8 @@ void
|
||||
_gdk_macos_display_surface_resigned_main (GdkMacosDisplay *self,
|
||||
GdkMacosSurface *surface)
|
||||
{
|
||||
GdkMacosSurface *new_surface = NULL;
|
||||
|
||||
g_return_if_fail (GDK_IS_MACOS_DISPLAY (self));
|
||||
g_return_if_fail (GDK_IS_MACOS_SURFACE (surface));
|
||||
|
||||
@@ -537,6 +496,40 @@ _gdk_macos_display_surface_resigned_main (GdkMacosDisplay *self,
|
||||
g_queue_unlink (&self->main_surfaces, &surface->main);
|
||||
|
||||
_gdk_macos_display_clear_sorting (self);
|
||||
|
||||
if (GDK_SURFACE (surface)->transient_for &&
|
||||
gdk_surface_get_mapped (GDK_SURFACE (surface)->transient_for))
|
||||
{
|
||||
new_surface = GDK_MACOS_SURFACE (GDK_SURFACE (surface)->transient_for);
|
||||
}
|
||||
else
|
||||
{
|
||||
const GList *surfaces = _gdk_macos_display_get_surfaces (self);
|
||||
|
||||
for (const GList *iter = surfaces; iter; iter = iter->next)
|
||||
{
|
||||
GdkMacosSurface *item = iter->data;
|
||||
|
||||
g_assert (GDK_IS_MACOS_SURFACE (item));
|
||||
|
||||
if (item == surface)
|
||||
continue;
|
||||
|
||||
if (GDK_SURFACE_IS_MAPPED (GDK_SURFACE (item)))
|
||||
{
|
||||
new_surface = item;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (new_surface != NULL)
|
||||
{
|
||||
NSWindow *nswindow = _gdk_macos_surface_get_native (new_surface);
|
||||
[nswindow makeKeyAndOrderFront:nswindow];
|
||||
}
|
||||
|
||||
_gdk_macos_display_clear_sorting (self);
|
||||
}
|
||||
|
||||
static GdkSurface *
|
||||
@@ -599,7 +592,6 @@ gdk_macos_display_finalize (GObject *object)
|
||||
|
||||
_gdk_macos_display_feedback_destroy (self);
|
||||
|
||||
g_clear_handle_id (&self->select_key_in_idle, g_source_remove);
|
||||
g_clear_pointer (&self->active_drags, g_hash_table_unref);
|
||||
g_clear_pointer (&self->active_drops, g_hash_table_unref);
|
||||
g_clear_object (&GDK_DISPLAY (self)->clipboard);
|
||||
@@ -964,16 +956,11 @@ _gdk_macos_display_get_surfaces (GdkMacosDisplay *self)
|
||||
NSArray *array = [NSApp orderedWindows];
|
||||
GQueue sorted = G_QUEUE_INIT;
|
||||
|
||||
self->key_window_is_foregin = FALSE;
|
||||
|
||||
for (id obj in array)
|
||||
{
|
||||
NSWindow *nswindow = (NSWindow *)obj;
|
||||
GdkMacosSurface *surface;
|
||||
|
||||
if ([nswindow isKeyWindow])
|
||||
self->key_window_is_foregin = !GDK_IS_MACOS_WINDOW (nswindow);
|
||||
|
||||
if (!GDK_IS_MACOS_WINDOW (nswindow))
|
||||
continue;
|
||||
|
||||
|
||||
@@ -38,6 +38,8 @@ struct _GdkMacosGLContext
|
||||
{
|
||||
GdkGLContext parent_instance;
|
||||
|
||||
cairo_region_t *damage;
|
||||
|
||||
G_GNUC_BEGIN_IGNORE_DEPRECATIONS
|
||||
CGLContextObj cgl_context;
|
||||
G_GNUC_END_IGNORE_DEPRECATIONS
|
||||
|
||||
@@ -469,7 +469,6 @@ gdk_macos_gl_context_begin_frame (GdkDrawContext *context,
|
||||
buffer = _gdk_macos_surface_get_buffer (GDK_MACOS_SURFACE (surface));
|
||||
|
||||
_gdk_macos_buffer_set_flipped (buffer, TRUE);
|
||||
_gdk_macos_buffer_set_damage (buffer, region);
|
||||
|
||||
/* Create our render target and bind it */
|
||||
gdk_gl_context_make_current (GDK_GL_CONTEXT (self));
|
||||
@@ -477,6 +476,9 @@ gdk_macos_gl_context_begin_frame (GdkDrawContext *context,
|
||||
|
||||
GDK_DRAW_CONTEXT_CLASS (gdk_macos_gl_context_parent_class)->begin_frame (context, prefers_high_depth, region);
|
||||
|
||||
g_clear_pointer (&self->damage, cairo_region_destroy);
|
||||
self->damage = g_steal_pointer (©);
|
||||
|
||||
gdk_gl_context_make_current (GDK_GL_CONTEXT (self));
|
||||
CHECK_GL (NULL, glBindFramebuffer (GL_FRAMEBUFFER, self->fbo));
|
||||
}
|
||||
@@ -529,6 +531,8 @@ gdk_macos_gl_context_surface_resized (GdkDrawContext *draw_context)
|
||||
|
||||
g_assert (GDK_IS_MACOS_GL_CONTEXT (self));
|
||||
|
||||
g_clear_pointer (&self->damage, cairo_region_destroy);
|
||||
|
||||
if (self->cgl_context != NULL)
|
||||
CGLUpdateContext (self->cgl_context);
|
||||
}
|
||||
@@ -583,16 +587,9 @@ static cairo_region_t *
|
||||
gdk_macos_gl_context_get_damage (GdkGLContext *context)
|
||||
{
|
||||
GdkMacosGLContext *self = (GdkMacosGLContext *)context;
|
||||
const cairo_region_t *damage;
|
||||
GdkMacosBuffer *buffer;
|
||||
GdkSurface *surface;
|
||||
|
||||
g_assert (GDK_IS_MACOS_GL_CONTEXT (self));
|
||||
|
||||
if ((surface = gdk_draw_context_get_surface (GDK_DRAW_CONTEXT (context))) &&
|
||||
(buffer = GDK_MACOS_SURFACE (surface)->front) &&
|
||||
(damage = _gdk_macos_buffer_get_damage (buffer)))
|
||||
return cairo_region_copy (damage);
|
||||
if (self->damage)
|
||||
return cairo_region_copy (self->damage);
|
||||
|
||||
return GDK_GL_CONTEXT_CLASS (gdk_macos_gl_context_parent_class)->get_damage (context);
|
||||
}
|
||||
@@ -622,6 +619,8 @@ gdk_macos_gl_context_dispose (GObject *gobject)
|
||||
CGLDestroyContext (cgl_context);
|
||||
}
|
||||
|
||||
g_clear_pointer (&self->damage, cairo_region_destroy);
|
||||
|
||||
G_OBJECT_CLASS (gdk_macos_gl_context_parent_class)->dispose (gobject);
|
||||
}
|
||||
|
||||
|
||||
@@ -41,8 +41,6 @@ void _gdk_macos_monitor_add_frame_callback (GdkMacosMonitor *
|
||||
GdkMacosSurface *surface);
|
||||
void _gdk_macos_monitor_remove_frame_callback (GdkMacosMonitor *self,
|
||||
GdkMacosSurface *surface);
|
||||
void _gdk_macos_monitor_clamp (GdkMacosMonitor *self,
|
||||
GdkRectangle *area);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -431,29 +431,3 @@ _gdk_macos_monitor_remove_frame_callback (GdkMacosMonitor *self,
|
||||
gdk_display_link_source_pause (self->display_link);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
_gdk_macos_monitor_clamp (GdkMacosMonitor *self,
|
||||
GdkRectangle *area)
|
||||
{
|
||||
GdkRectangle workarea;
|
||||
GdkRectangle geom;
|
||||
|
||||
g_return_if_fail (GDK_IS_MACOS_MONITOR (self));
|
||||
g_return_if_fail (area != NULL);
|
||||
|
||||
gdk_macos_monitor_get_workarea (GDK_MONITOR (self), &workarea);
|
||||
gdk_monitor_get_geometry (GDK_MONITOR (self), &geom);
|
||||
|
||||
if (area->x + area->width > workarea.x + workarea.width)
|
||||
area->x = workarea.x + workarea.width - area->width;
|
||||
|
||||
if (area->x < workarea.x)
|
||||
area->x = workarea.x;
|
||||
|
||||
if (area->y + area->height > workarea.y + workarea.height)
|
||||
area->y = workarea.y + workarea.height - area->height;
|
||||
|
||||
if (area->y < workarea.y)
|
||||
area->y = workarea.y;
|
||||
}
|
||||
|
||||
@@ -34,7 +34,6 @@ struct _GdkMacosPopupSurface
|
||||
{
|
||||
GdkMacosSurface parent_instance;
|
||||
GdkPopupLayout *layout;
|
||||
guint attached : 1;
|
||||
};
|
||||
|
||||
struct _GdkMacosPopupSurfaceClass
|
||||
@@ -139,9 +138,6 @@ gdk_macos_popup_surface_present (GdkPopup *popup,
|
||||
if (GDK_SURFACE_IS_MAPPED (GDK_SURFACE (self)))
|
||||
return TRUE;
|
||||
|
||||
if (!self->attached && GDK_SURFACE (self)->parent != NULL)
|
||||
_gdk_macos_popup_surface_attach_to_parent (self);
|
||||
|
||||
if (GDK_SURFACE (self)->autohide)
|
||||
{
|
||||
GdkDisplay *display = gdk_surface_get_display (GDK_SURFACE (popup));
|
||||
@@ -207,19 +203,6 @@ enum {
|
||||
LAST_PROP,
|
||||
};
|
||||
|
||||
static void
|
||||
_gdk_macos_popup_surface_hide (GdkSurface *surface)
|
||||
{
|
||||
GdkMacosPopupSurface *self = (GdkMacosPopupSurface *)surface;
|
||||
|
||||
g_assert (GDK_IS_MACOS_POPUP_SURFACE (self));
|
||||
|
||||
if (self->attached)
|
||||
_gdk_macos_popup_surface_detach_from_parent (self);
|
||||
|
||||
GDK_SURFACE_CLASS (_gdk_macos_popup_surface_parent_class)->hide (surface);
|
||||
}
|
||||
|
||||
static void
|
||||
_gdk_macos_popup_surface_finalize (GObject *object)
|
||||
{
|
||||
@@ -287,15 +270,12 @@ static void
|
||||
_gdk_macos_popup_surface_class_init (GdkMacosPopupSurfaceClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GdkSurfaceClass *surface_class = GDK_SURFACE_CLASS (klass);
|
||||
|
||||
object_class->finalize = _gdk_macos_popup_surface_finalize;
|
||||
object_class->get_property = _gdk_macos_popup_surface_get_property;
|
||||
object_class->set_property = _gdk_macos_popup_surface_set_property;
|
||||
|
||||
surface_class->hide = _gdk_macos_popup_surface_hide;
|
||||
|
||||
gdk_popup_install_properties (object_class, LAST_PROP);
|
||||
gdk_popup_install_properties (object_class, 1);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -346,8 +326,14 @@ _gdk_macos_popup_surface_new (GdkMacosDisplay *display,
|
||||
[window setOpaque:NO];
|
||||
[window setBackgroundColor:[NSColor clearColor]];
|
||||
[window setDecorated:NO];
|
||||
[window setExcludedFromWindowsMenu:YES];
|
||||
|
||||
#if 0
|
||||
/* NOTE: We could set these to be popup level, but then
|
||||
* [NSApp orderedWindows] would not give us the windows
|
||||
* back with the stacking order applied.
|
||||
*/
|
||||
[window setLevel:NSPopUpMenuWindowLevel];
|
||||
#endif
|
||||
|
||||
self = g_object_new (GDK_TYPE_MACOS_POPUP_SURFACE,
|
||||
"display", display,
|
||||
@@ -378,8 +364,6 @@ _gdk_macos_popup_surface_attach_to_parent (GdkMacosPopupSurface *self)
|
||||
|
||||
[parent addChildWindow:window ordered:NSWindowAbove];
|
||||
|
||||
self->attached = TRUE;
|
||||
|
||||
_gdk_macos_display_clear_sorting (GDK_MACOS_DISPLAY (surface->display));
|
||||
}
|
||||
}
|
||||
@@ -401,8 +385,6 @@ _gdk_macos_popup_surface_detach_from_parent (GdkMacosPopupSurface *self)
|
||||
|
||||
[parent removeChildWindow:window];
|
||||
|
||||
self->attached = FALSE;
|
||||
|
||||
_gdk_macos_display_clear_sorting (GDK_MACOS_DISPLAY (surface->display));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,6 @@ struct _GdkMacosSurface
|
||||
guint geometry_dirty : 1;
|
||||
guint next_frame_set : 1;
|
||||
guint show_on_next_swap : 1;
|
||||
guint in_change_monitor : 1;
|
||||
guint in_frame : 1;
|
||||
guint awaiting_frame : 1;
|
||||
};
|
||||
|
||||
@@ -72,12 +72,9 @@ _gdk_macos_surface_request_frame (GdkMacosSurface *self)
|
||||
if (self->awaiting_frame)
|
||||
return;
|
||||
|
||||
if (self->best_monitor != NULL)
|
||||
{
|
||||
self->awaiting_frame = TRUE;
|
||||
_gdk_macos_monitor_add_frame_callback (GDK_MACOS_MONITOR (self->best_monitor), self);
|
||||
gdk_surface_freeze_updates (GDK_SURFACE (self));
|
||||
}
|
||||
self->awaiting_frame = TRUE;
|
||||
_gdk_macos_monitor_add_frame_callback (GDK_MACOS_MONITOR (self->best_monitor), self);
|
||||
gdk_surface_freeze_updates (GDK_SURFACE (self));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -88,12 +85,9 @@ _gdk_macos_surface_cancel_frame (GdkMacosSurface *self)
|
||||
if (!self->awaiting_frame)
|
||||
return;
|
||||
|
||||
if (self->best_monitor != NULL)
|
||||
{
|
||||
self->awaiting_frame = FALSE;
|
||||
_gdk_macos_monitor_remove_frame_callback (GDK_MACOS_MONITOR (self->best_monitor), self);
|
||||
gdk_surface_thaw_updates (GDK_SURFACE (self));
|
||||
}
|
||||
self->awaiting_frame = FALSE;
|
||||
_gdk_macos_monitor_remove_frame_callback (GDK_MACOS_MONITOR (self->best_monitor), self);
|
||||
gdk_surface_thaw_updates (GDK_SURFACE (self));
|
||||
}
|
||||
|
||||
void
|
||||
@@ -158,6 +152,9 @@ _gdk_macos_surface_reposition_children (GdkMacosSurface *self)
|
||||
if (GDK_IS_MACOS_POPUP_SURFACE (child))
|
||||
_gdk_macos_popup_surface_reposition (GDK_MACOS_POPUP_SURFACE (child));
|
||||
}
|
||||
|
||||
if (GDK_IS_POPUP (self) && self->did_initial_present)
|
||||
gdk_surface_request_layout (GDK_SURFACE (self));
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -202,9 +199,7 @@ gdk_macos_surface_hide (GdkSurface *surface)
|
||||
|
||||
self->show_on_next_swap = FALSE;
|
||||
|
||||
_gdk_macos_surface_cancel_frame (self);
|
||||
|
||||
was_mapped = GDK_SURFACE_IS_MAPPED (surface);
|
||||
was_mapped = GDK_SURFACE_IS_MAPPED (GDK_SURFACE (self));
|
||||
was_key = [self->window isKeyWindow];
|
||||
|
||||
seat = gdk_display_get_default_seat (surface->display);
|
||||
@@ -219,21 +214,21 @@ gdk_macos_surface_hide (GdkSurface *surface)
|
||||
|
||||
if (was_key)
|
||||
{
|
||||
GdkSurface *parent;
|
||||
|
||||
if (GDK_IS_TOPLEVEL (surface))
|
||||
parent = surface->transient_for;
|
||||
else
|
||||
parent = surface->parent;
|
||||
|
||||
/* Return key input to the parent window if necessary */
|
||||
if (parent != NULL && GDK_SURFACE_IS_MAPPED (parent))
|
||||
if (surface->parent != NULL && GDK_SURFACE_IS_MAPPED (surface->parent))
|
||||
{
|
||||
GdkMacosWindow *parentWindow = GDK_MACOS_SURFACE (parent)->window;
|
||||
GdkMacosWindow *parentWindow = GDK_MACOS_SURFACE (surface->parent)->window;
|
||||
|
||||
[parentWindow showAndMakeKey:YES];
|
||||
}
|
||||
}
|
||||
|
||||
if (self->awaiting_frame)
|
||||
{
|
||||
self->awaiting_frame = FALSE;
|
||||
_gdk_macos_monitor_remove_frame_callback (GDK_MACOS_MONITOR (self->best_monitor), self);
|
||||
gdk_surface_freeze_updates (surface);
|
||||
}
|
||||
}
|
||||
|
||||
static int
|
||||
@@ -474,8 +469,16 @@ gdk_macos_surface_destroy (GdkSurface *surface,
|
||||
GdkMacosWindow *window = g_steal_pointer (&self->window);
|
||||
GdkFrameClock *frame_clock;
|
||||
|
||||
_gdk_macos_surface_cancel_frame (self);
|
||||
g_clear_object (&self->best_monitor);
|
||||
if (self->best_monitor)
|
||||
{
|
||||
if (self->awaiting_frame)
|
||||
{
|
||||
_gdk_macos_monitor_remove_frame_callback (GDK_MACOS_MONITOR (self->best_monitor), self);
|
||||
self->awaiting_frame = FALSE;
|
||||
}
|
||||
|
||||
g_clear_object (&self->best_monitor);
|
||||
}
|
||||
|
||||
if ((frame_clock = gdk_surface_get_frame_clock (GDK_SURFACE (self))))
|
||||
{
|
||||
@@ -633,10 +636,7 @@ _gdk_macos_surface_new (GdkMacosDisplay *display,
|
||||
|
||||
g_return_val_if_fail (GDK_IS_MACOS_DISPLAY (display), NULL);
|
||||
|
||||
if (parent != NULL)
|
||||
frame_clock = g_object_ref (parent->frame_clock);
|
||||
else
|
||||
frame_clock = _gdk_frame_clock_idle_new ();
|
||||
frame_clock = _gdk_frame_clock_idle_new ();
|
||||
|
||||
switch (surface_type)
|
||||
{
|
||||
@@ -844,9 +844,8 @@ _gdk_macos_surface_update_fullscreen_state (GdkMacosSurface *self)
|
||||
void
|
||||
_gdk_macos_surface_configure (GdkMacosSurface *self)
|
||||
{
|
||||
GdkSurface *surface = (GdkSurface *)self;
|
||||
GdkMacosDisplay *display;
|
||||
GdkMacosSurface *parent;
|
||||
GdkSurface *surface = (GdkSurface *)self;
|
||||
NSRect frame_rect;
|
||||
NSRect content_rect;
|
||||
|
||||
@@ -855,13 +854,6 @@ _gdk_macos_surface_configure (GdkMacosSurface *self)
|
||||
if (GDK_SURFACE_DESTROYED (self))
|
||||
return;
|
||||
|
||||
if (surface->parent != NULL)
|
||||
parent = GDK_MACOS_SURFACE (surface->parent);
|
||||
else if (surface->transient_for != NULL)
|
||||
parent = GDK_MACOS_SURFACE (surface->transient_for);
|
||||
else
|
||||
parent = NULL;
|
||||
|
||||
display = GDK_MACOS_DISPLAY (GDK_SURFACE (self)->display);
|
||||
frame_rect = [self->window frame];
|
||||
content_rect = [self->window contentRectForFrameRect:frame_rect];
|
||||
@@ -871,10 +863,10 @@ _gdk_macos_surface_configure (GdkMacosSurface *self)
|
||||
content_rect.origin.y + content_rect.size.height,
|
||||
&self->root_x, &self->root_y);
|
||||
|
||||
if (parent != NULL)
|
||||
if (surface->parent != NULL)
|
||||
{
|
||||
surface->x = self->root_x - parent->root_x;
|
||||
surface->y = self->root_y - parent->root_y;
|
||||
surface->x = self->root_x - GDK_MACOS_SURFACE (surface->parent)->root_x;
|
||||
surface->y = self->root_y - GDK_MACOS_SURFACE (surface->parent)->root_y;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -892,6 +884,7 @@ _gdk_macos_surface_configure (GdkMacosSurface *self)
|
||||
g_clear_object (&self->front);
|
||||
|
||||
_gdk_surface_update_size (surface);
|
||||
gdk_surface_request_layout (surface);
|
||||
gdk_surface_invalidate_rect (surface, NULL);
|
||||
}
|
||||
|
||||
@@ -917,7 +910,6 @@ _gdk_macos_surface_show (GdkMacosSurface *self)
|
||||
{
|
||||
gdk_surface_set_is_mapped (GDK_SURFACE (self), TRUE);
|
||||
gdk_surface_request_layout (GDK_SURFACE (self));
|
||||
gdk_surface_invalidate_rect (GDK_SURFACE (self), NULL);
|
||||
gdk_surface_thaw_updates (GDK_SURFACE (self));
|
||||
}
|
||||
}
|
||||
@@ -973,27 +965,13 @@ _gdk_macos_surface_move_resize (GdkMacosSurface *self,
|
||||
NSRect frame_rect;
|
||||
gboolean ignore_move;
|
||||
gboolean ignore_size;
|
||||
GdkRectangle current;
|
||||
|
||||
g_return_if_fail (GDK_IS_MACOS_SURFACE (self));
|
||||
|
||||
/* Query for up-to-date values in case we're racing against
|
||||
* an incoming frame notify which could be queued behind whatever
|
||||
* we're processing right now.
|
||||
*/
|
||||
frame_rect = [self->window frame];
|
||||
content_rect = [self->window contentRectForFrameRect:frame_rect];
|
||||
_gdk_macos_display_from_display_coords (GDK_MACOS_DISPLAY (GDK_SURFACE (self)->display),
|
||||
content_rect.origin.x, content_rect.origin.y,
|
||||
¤t.x, ¤t.y);
|
||||
current.width = content_rect.size.width;
|
||||
current.height = content_rect.size.height;
|
||||
|
||||
/* Check if we can ignore the operation all together */
|
||||
ignore_move = (x == -1 || (x == current.x)) &&
|
||||
(y == -1 || (y == current.y));
|
||||
ignore_size = (width == -1 || (width == current.width)) &&
|
||||
(height == -1 || (height == current.height));
|
||||
ignore_move = (x == -1 || (x == self->root_x)) &&
|
||||
(y == -1 || (y == self->root_y));
|
||||
ignore_size = (width == -1 || (width == surface->width)) &&
|
||||
(height == -1 || (height == surface->height));
|
||||
|
||||
if (ignore_move && ignore_size)
|
||||
return;
|
||||
@@ -1001,21 +979,23 @@ _gdk_macos_surface_move_resize (GdkMacosSurface *self,
|
||||
display = gdk_surface_get_display (surface);
|
||||
|
||||
if (width == -1)
|
||||
width = current.width;
|
||||
width = surface->width;
|
||||
|
||||
if (height == -1)
|
||||
height = current.height;
|
||||
height = surface->height;
|
||||
|
||||
if (x == -1)
|
||||
x = current.x;
|
||||
x = self->root_x;
|
||||
|
||||
if (y == -1)
|
||||
y = current.y;
|
||||
y = self->root_y;
|
||||
|
||||
_gdk_macos_display_to_display_coords (GDK_MACOS_DISPLAY (display),
|
||||
x, y + height,
|
||||
&x, &y);
|
||||
|
||||
content_rect = [self->window contentRectForFrameRect:[self->window frame]];
|
||||
|
||||
if (!ignore_move)
|
||||
content_rect.origin = NSMakePoint (x, y);
|
||||
|
||||
@@ -1023,7 +1003,7 @@ _gdk_macos_surface_move_resize (GdkMacosSurface *self,
|
||||
content_rect.size = NSMakeSize (width, height);
|
||||
|
||||
frame_rect = [self->window frameRectForContentRect:content_rect];
|
||||
[self->window setFrame:frame_rect display:NO];
|
||||
[self->window setFrame:frame_rect display:YES];
|
||||
}
|
||||
|
||||
void
|
||||
@@ -1088,13 +1068,7 @@ _gdk_macos_surface_monitor_changed (GdkMacosSurface *self)
|
||||
|
||||
g_return_if_fail (GDK_IS_MACOS_SURFACE (self));
|
||||
|
||||
if (self->in_change_monitor)
|
||||
return;
|
||||
|
||||
self->in_change_monitor = TRUE;
|
||||
|
||||
_gdk_macos_surface_cancel_frame (self);
|
||||
_gdk_macos_surface_configure (self);
|
||||
|
||||
rect.x = self->root_x;
|
||||
rect.y = self->root_y;
|
||||
@@ -1158,42 +1132,11 @@ _gdk_macos_surface_monitor_changed (GdkMacosSurface *self)
|
||||
g_message ("Surface \"%s\" moved to monitor \"%s\"",
|
||||
self->title ? self->title : "unknown",
|
||||
gdk_monitor_get_connector (best)));
|
||||
|
||||
_gdk_macos_surface_configure (self);
|
||||
|
||||
if (GDK_SURFACE_IS_MAPPED (GDK_SURFACE (self)))
|
||||
{
|
||||
_gdk_macos_surface_request_frame (self);
|
||||
gdk_surface_request_layout (GDK_SURFACE (self));
|
||||
}
|
||||
|
||||
for (const GList *iter = GDK_SURFACE (self)->children;
|
||||
iter != NULL;
|
||||
iter = iter->next)
|
||||
{
|
||||
GdkMacosSurface *child = iter->data;
|
||||
GdkRectangle area;
|
||||
|
||||
g_set_object (&child->best_monitor, best);
|
||||
|
||||
area.x = self->root_x + GDK_SURFACE (child)->x + child->shadow_left;
|
||||
area.y = self->root_y + GDK_SURFACE (child)->y + child->shadow_top;
|
||||
area.width = GDK_SURFACE (child)->width - child->shadow_left - child->shadow_right;
|
||||
area.height = GDK_SURFACE (child)->height - child->shadow_top - child->shadow_bottom;
|
||||
|
||||
_gdk_macos_monitor_clamp (GDK_MACOS_MONITOR (best), &area);
|
||||
|
||||
area.x -= child->shadow_left;
|
||||
area.y -= child->shadow_top;
|
||||
|
||||
_gdk_macos_surface_move (child, area.x, area.y);
|
||||
gdk_surface_invalidate_rect (GDK_SURFACE (child), NULL);
|
||||
}
|
||||
}
|
||||
|
||||
_gdk_macos_surface_configure (self);
|
||||
gdk_surface_invalidate_rect (GDK_SURFACE (self), NULL);
|
||||
|
||||
self->in_change_monitor = FALSE;
|
||||
_gdk_macos_surface_request_frame (self);
|
||||
}
|
||||
|
||||
GdkMonitor *
|
||||
@@ -1277,15 +1220,11 @@ _gdk_macos_surface_get_buffer (GdkMacosSurface *self)
|
||||
static void
|
||||
_gdk_macos_surface_do_delayed_show (GdkMacosSurface *self)
|
||||
{
|
||||
GdkSurface *surface = (GdkSurface *)self;
|
||||
|
||||
g_assert (GDK_IS_MACOS_SURFACE (self));
|
||||
|
||||
self->show_on_next_swap = FALSE;
|
||||
[self->window showAndMakeKey:YES];
|
||||
|
||||
_gdk_macos_display_clear_sorting (GDK_MACOS_DISPLAY (surface->display));
|
||||
gdk_surface_request_motion (surface);
|
||||
gdk_surface_request_motion (GDK_SURFACE (self));
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
@@ -648,10 +648,10 @@ _gdk_macos_toplevel_surface_new (GdkMacosDisplay *display,
|
||||
|
||||
GdkMacosWindow *window;
|
||||
GdkMacosSurface *self;
|
||||
NSScreen *screen;
|
||||
NSUInteger style_mask;
|
||||
NSRect content_rect;
|
||||
NSRect visible_frame;
|
||||
NSScreen *screen;
|
||||
NSRect screen_rect;
|
||||
int nx;
|
||||
int ny;
|
||||
|
||||
@@ -664,17 +664,14 @@ _gdk_macos_toplevel_surface_new (GdkMacosDisplay *display,
|
||||
NSWindowStyleMaskMiniaturizable |
|
||||
NSWindowStyleMaskResizable);
|
||||
|
||||
if (parent != NULL)
|
||||
{
|
||||
x += GDK_MACOS_SURFACE (parent)->root_x;
|
||||
y += GDK_MACOS_SURFACE (parent)->root_y;
|
||||
}
|
||||
|
||||
_gdk_macos_display_to_display_coords (display, x, y + height, &nx, &ny);
|
||||
_gdk_macos_display_to_display_coords (display, x, y, &nx, &ny);
|
||||
|
||||
screen = _gdk_macos_display_get_screen_at_display_coords (display, nx, ny);
|
||||
visible_frame = [screen visibleFrame];
|
||||
content_rect = NSMakeRect (nx - visible_frame.origin.x, ny - visible_frame.origin.y, width, height);
|
||||
screen_rect = [screen visibleFrame];
|
||||
nx -= screen_rect.origin.x;
|
||||
ny -= screen_rect.origin.y;
|
||||
content_rect = NSMakeRect (nx, ny - height, width, height);
|
||||
|
||||
window = [[GdkMacosWindow alloc] initWithContentRect:content_rect
|
||||
styleMask:style_mask
|
||||
backing:NSBackingStoreBuffered
|
||||
@@ -710,21 +707,13 @@ _gdk_macos_toplevel_surface_attach_to_parent (GdkMacosToplevelSurface *self)
|
||||
{
|
||||
NSWindow *parent = _gdk_macos_surface_get_native (GDK_MACOS_SURFACE (surface->transient_for));
|
||||
NSWindow *window = _gdk_macos_surface_get_native (GDK_MACOS_SURFACE (self));
|
||||
int x, y;
|
||||
|
||||
[parent addChildWindow:window ordered:NSWindowAbove];
|
||||
|
||||
if (GDK_SURFACE (self)->modal_hint)
|
||||
[window setLevel:NSModalPanelWindowLevel];
|
||||
|
||||
surface->x = 0;
|
||||
surface->y = 0;
|
||||
|
||||
_gdk_macos_display_clear_sorting (GDK_MACOS_DISPLAY (surface->display));
|
||||
_gdk_macos_display_position_surface (GDK_MACOS_DISPLAY (surface->display),
|
||||
GDK_MACOS_SURFACE (surface),
|
||||
&x, &y);
|
||||
_gdk_macos_surface_move (GDK_MACOS_SURFACE (surface), x, y);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -73,9 +73,8 @@ gdk_wayland_app_launch_context_get_startup_notify_id (GAppLaunchContext *context
|
||||
xdg_activation_token_v1_set_serial (token,
|
||||
_gdk_wayland_seat_get_last_implicit_grab_serial (seat, NULL),
|
||||
gdk_wayland_seat_get_wl_seat (GDK_SEAT (seat)));
|
||||
if (focus_surface)
|
||||
xdg_activation_token_v1_set_surface (token,
|
||||
gdk_wayland_surface_get_wl_surface (focus_surface));
|
||||
xdg_activation_token_v1_set_surface (token,
|
||||
gdk_wayland_surface_get_wl_surface (focus_surface));
|
||||
xdg_activation_token_v1_commit (token);
|
||||
|
||||
while (app_launch_data.token == NULL)
|
||||
|
||||
@@ -5130,10 +5130,10 @@ gsk_gl_shader_node_diff (GskRenderNode *node1,
|
||||
* @shader: the `GskGLShader`
|
||||
* @bounds: the rectangle to render the shader into
|
||||
* @args: Arguments for the uniforms
|
||||
* @children: (nullable) (array length=n_children): array of child nodes,
|
||||
* these will be rendered to textures and used as input.
|
||||
* @children: (array length=n_children): array of child nodes, these will
|
||||
* be rendered to textures and used as input.
|
||||
* @n_children: Length of @children (currenly the GL backend supports
|
||||
* up to 4 children)
|
||||
* up to 4 children)
|
||||
*
|
||||
* Creates a `GskRenderNode` that will render the given @shader into the
|
||||
* area given by @bounds.
|
||||
@@ -5167,10 +5167,10 @@ gsk_gl_shader_node_new (GskGLShader *shader,
|
||||
|
||||
g_return_val_if_fail (GSK_IS_GL_SHADER (shader), NULL);
|
||||
g_return_val_if_fail (bounds != NULL, NULL);
|
||||
g_return_val_if_fail (args != NULL, NULL);
|
||||
g_return_val_if_fail (g_bytes_get_size (args) == gsk_gl_shader_get_args_size (shader), NULL);
|
||||
g_return_val_if_fail ((args == NULL && gsk_gl_shader_get_n_uniforms (shader) == 0) ||
|
||||
(args != NULL && g_bytes_get_size (args) == gsk_gl_shader_get_args_size (shader)), NULL);
|
||||
g_return_val_if_fail ((children == NULL && n_children == 0) ||
|
||||
(n_children == gsk_gl_shader_get_n_textures (shader)), NULL);
|
||||
(children != NULL && n_children == gsk_gl_shader_get_n_textures (shader)), NULL);
|
||||
|
||||
self = gsk_render_node_alloc (GSK_GL_SHADER_NODE);
|
||||
node = (GskRenderNode *) self;
|
||||
|
||||
@@ -425,7 +425,7 @@ gtk_accessible_reset_property (GtkAccessible *self,
|
||||
* gtk_accessible_update_relation (accessible,
|
||||
* GTK_ACCESSIBLE_RELATION_CONTROLS,
|
||||
* ref1, NULL,
|
||||
* GTK_ACCESSIBLE_RELATION_LABELLED_BY,
|
||||
* GTK_ACCESSIBLE_LABELLED_BY,
|
||||
* ref1, ref2, ref3, NULL,
|
||||
* -1);
|
||||
* ```
|
||||
|
||||
@@ -38,7 +38,7 @@ struct _GtkBinLayout
|
||||
GtkLayoutManager parent_instance;
|
||||
};
|
||||
|
||||
G_DEFINE_FINAL_TYPE (GtkBinLayout, gtk_bin_layout, GTK_TYPE_LAYOUT_MANAGER)
|
||||
G_DEFINE_TYPE (GtkBinLayout, gtk_bin_layout, GTK_TYPE_LAYOUT_MANAGER)
|
||||
|
||||
static void
|
||||
gtk_bin_layout_measure (GtkLayoutManager *layout_manager,
|
||||
|
||||
@@ -117,8 +117,8 @@ static void bookmark_file_changed (GFileMonitor *monitor,
|
||||
static void gtk_bookmark_list_set_filename (GtkBookmarkList *self,
|
||||
const char *filename);
|
||||
|
||||
G_DEFINE_FINAL_TYPE_WITH_CODE (GtkBookmarkList, gtk_bookmark_list, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, gtk_bookmark_list_model_init))
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkBookmarkList, gtk_bookmark_list, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, gtk_bookmark_list_model_init))
|
||||
|
||||
static void
|
||||
gtk_bookmark_list_set_property (GObject *object,
|
||||
|
||||
@@ -46,7 +46,7 @@ enum {
|
||||
NUM_PROPERTIES
|
||||
};
|
||||
|
||||
G_DEFINE_FINAL_TYPE (GtkBoolFilter, gtk_bool_filter, GTK_TYPE_FILTER)
|
||||
G_DEFINE_TYPE (GtkBoolFilter, gtk_bool_filter, GTK_TYPE_FILTER)
|
||||
|
||||
static GParamSpec *properties[NUM_PROPERTIES] = { NULL, };
|
||||
|
||||
@@ -106,7 +106,7 @@ gtk_bool_filter_set_property (GObject *object,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
gtk_bool_filter_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
|
||||
@@ -58,8 +58,8 @@ struct _GtkBoxLayout
|
||||
GtkBaselinePosition baseline_position;
|
||||
};
|
||||
|
||||
G_DEFINE_FINAL_TYPE_WITH_CODE (GtkBoxLayout, gtk_box_layout, GTK_TYPE_LAYOUT_MANAGER,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE, NULL))
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkBoxLayout, gtk_box_layout, GTK_TYPE_LAYOUT_MANAGER,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_ORIENTABLE, NULL))
|
||||
|
||||
enum {
|
||||
PROP_HOMOGENEOUS = 1,
|
||||
@@ -342,7 +342,7 @@ distribute_remaining_size (GtkRequestedSize *sizes,
|
||||
else
|
||||
max = test;
|
||||
}
|
||||
|
||||
|
||||
return available - total_size;
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ struct _GtkCenterLayout
|
||||
};
|
||||
};
|
||||
|
||||
G_DEFINE_FINAL_TYPE (GtkCenterLayout, gtk_center_layout, GTK_TYPE_LAYOUT_MANAGER)
|
||||
G_DEFINE_TYPE (GtkCenterLayout, gtk_center_layout, GTK_TYPE_LAYOUT_MANAGER)
|
||||
|
||||
static int
|
||||
get_spacing (GtkCenterLayout *self,
|
||||
@@ -523,26 +523,11 @@ gtk_center_layout_allocate (GtkLayoutManager *layout_manager,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_center_layout_dispose (GObject *object)
|
||||
{
|
||||
GtkCenterLayout *self = GTK_CENTER_LAYOUT (object);
|
||||
|
||||
g_clear_object (&self->start_widget);
|
||||
g_clear_object (&self->center_widget);
|
||||
g_clear_object (&self->end_widget);
|
||||
|
||||
G_OBJECT_CLASS (gtk_center_layout_parent_class)->dispose (object);
|
||||
}
|
||||
|
||||
static void
|
||||
gtk_center_layout_class_init (GtkCenterLayoutClass *klass)
|
||||
{
|
||||
GObjectClass *object_class = G_OBJECT_CLASS (klass);
|
||||
GtkLayoutManagerClass *layout_class = GTK_LAYOUT_MANAGER_CLASS (klass);
|
||||
|
||||
object_class->dispose = gtk_center_layout_dispose;
|
||||
|
||||
layout_class->get_request_mode = gtk_center_layout_get_request_mode;
|
||||
layout_class->measure = gtk_center_layout_measure;
|
||||
layout_class->allocate = gtk_center_layout_allocate;
|
||||
@@ -656,8 +641,11 @@ gtk_center_layout_set_start_widget (GtkCenterLayout *self,
|
||||
g_return_if_fail (GTK_IS_CENTER_LAYOUT (self));
|
||||
g_return_if_fail (widget == NULL || GTK_IS_WIDGET (widget));
|
||||
|
||||
if (g_set_object (&self->start_widget, widget))
|
||||
gtk_layout_manager_layout_changed (GTK_LAYOUT_MANAGER (self));
|
||||
if (self->start_widget == widget)
|
||||
return;
|
||||
|
||||
self->start_widget = widget;
|
||||
gtk_layout_manager_layout_changed (GTK_LAYOUT_MANAGER (self));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -692,8 +680,11 @@ gtk_center_layout_set_center_widget (GtkCenterLayout *self,
|
||||
g_return_if_fail (GTK_IS_CENTER_LAYOUT (self));
|
||||
g_return_if_fail (widget == NULL || GTK_IS_WIDGET (widget));
|
||||
|
||||
if (g_set_object (&self->center_widget, widget))
|
||||
gtk_layout_manager_layout_changed (GTK_LAYOUT_MANAGER (self));
|
||||
if (self->center_widget == widget)
|
||||
return;
|
||||
|
||||
self->center_widget = widget;
|
||||
gtk_layout_manager_layout_changed (GTK_LAYOUT_MANAGER (self));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -715,7 +706,7 @@ gtk_center_layout_get_center_widget (GtkCenterLayout *self)
|
||||
/**
|
||||
* gtk_center_layout_set_end_widget:
|
||||
* @self: a `GtkCenterLayout`
|
||||
* @widget: (nullable): the new end widget
|
||||
* @widget: (nullable) (transfer none): the new end widget
|
||||
*
|
||||
* Sets the new end widget of @self.
|
||||
*
|
||||
@@ -728,8 +719,11 @@ gtk_center_layout_set_end_widget (GtkCenterLayout *self,
|
||||
g_return_if_fail (GTK_IS_CENTER_LAYOUT (self));
|
||||
g_return_if_fail (widget == NULL || GTK_IS_WIDGET (widget));
|
||||
|
||||
if (g_set_object (&self->end_widget, widget))
|
||||
gtk_layout_manager_layout_changed (GTK_LAYOUT_MANAGER (self));
|
||||
if (self->end_widget == widget)
|
||||
return;
|
||||
|
||||
self->end_widget = widget;
|
||||
gtk_layout_manager_layout_changed (GTK_LAYOUT_MANAGER (self));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -60,7 +60,7 @@ enum {
|
||||
|
||||
static GParamSpec *obj_props[N_PROPERTIES];
|
||||
|
||||
G_DEFINE_FINAL_TYPE (GtkConstraint, gtk_constraint, G_TYPE_OBJECT)
|
||||
G_DEFINE_TYPE (GtkConstraint, gtk_constraint, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
gtk_constraint_set_property (GObject *gobject,
|
||||
|
||||
@@ -59,7 +59,7 @@ typedef enum {
|
||||
} GuideValue;
|
||||
|
||||
struct _GtkConstraintGuide
|
||||
{
|
||||
{
|
||||
GObject parent_instance;
|
||||
|
||||
char *name;
|
||||
@@ -104,9 +104,9 @@ gtk_constraint_guide_constraint_target_iface_init (GtkConstraintTargetInterface
|
||||
{
|
||||
}
|
||||
|
||||
G_DEFINE_FINAL_TYPE_WITH_CODE (GtkConstraintGuide, gtk_constraint_guide, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_CONSTRAINT_TARGET,
|
||||
gtk_constraint_guide_constraint_target_iface_init))
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkConstraintGuide, gtk_constraint_guide, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_CONSTRAINT_TARGET,
|
||||
gtk_constraint_guide_constraint_target_iface_init))
|
||||
|
||||
static void
|
||||
gtk_constraint_guide_init (GtkConstraintGuide *guide)
|
||||
|
||||
@@ -266,7 +266,7 @@ struct _GtkConstraintLayout
|
||||
GListStore *guides_observer;
|
||||
};
|
||||
|
||||
G_DEFINE_FINAL_TYPE (GtkConstraintLayoutChild, gtk_constraint_layout_child, GTK_TYPE_LAYOUT_CHILD)
|
||||
G_DEFINE_TYPE (GtkConstraintLayoutChild, gtk_constraint_layout_child, GTK_TYPE_LAYOUT_CHILD)
|
||||
|
||||
GtkConstraintSolver *
|
||||
gtk_constraint_layout_get_solver (GtkConstraintLayout *self)
|
||||
@@ -537,8 +537,8 @@ gtk_constraint_layout_child_init (GtkConstraintLayoutChild *self)
|
||||
|
||||
static void gtk_buildable_interface_init (GtkBuildableIface *iface);
|
||||
|
||||
G_DEFINE_FINAL_TYPE_WITH_CODE (GtkConstraintLayout, gtk_constraint_layout, GTK_TYPE_LAYOUT_MANAGER,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE, gtk_buildable_interface_init))
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkConstraintLayout, gtk_constraint_layout, GTK_TYPE_LAYOUT_MANAGER,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE, gtk_buildable_interface_init))
|
||||
|
||||
static void
|
||||
gtk_constraint_layout_finalize (GObject *gobject)
|
||||
|
||||
@@ -38,7 +38,7 @@ struct _GtkCustomFilter
|
||||
GDestroyNotify user_destroy;
|
||||
};
|
||||
|
||||
G_DEFINE_FINAL_TYPE (GtkCustomFilter, gtk_custom_filter, GTK_TYPE_FILTER)
|
||||
G_DEFINE_TYPE (GtkCustomFilter, gtk_custom_filter, GTK_TYPE_FILTER)
|
||||
|
||||
static gboolean
|
||||
gtk_custom_filter_match (GtkFilter *filter,
|
||||
|
||||
@@ -22,7 +22,7 @@ struct _GtkCustomLayout
|
||||
GtkCustomAllocateFunc allocate_func;
|
||||
};
|
||||
|
||||
G_DEFINE_FINAL_TYPE (GtkCustomLayout, gtk_custom_layout, GTK_TYPE_LAYOUT_MANAGER)
|
||||
G_DEFINE_TYPE (GtkCustomLayout, gtk_custom_layout, GTK_TYPE_LAYOUT_MANAGER)
|
||||
|
||||
static GtkSizeRequestMode
|
||||
gtk_custom_layout_get_request_mode (GtkLayoutManager *manager,
|
||||
|
||||
@@ -39,7 +39,7 @@ struct _GtkCustomSorter
|
||||
GDestroyNotify user_destroy;
|
||||
};
|
||||
|
||||
G_DEFINE_FINAL_TYPE (GtkCustomSorter, gtk_custom_sorter, GTK_TYPE_SORTER)
|
||||
G_DEFINE_TYPE (GtkCustomSorter, gtk_custom_sorter, GTK_TYPE_SORTER)
|
||||
|
||||
static GtkOrdering
|
||||
gtk_custom_sorter_compare (GtkSorter *sorter,
|
||||
|
||||
@@ -144,8 +144,8 @@ gtk_directory_list_model_init (GListModelInterface *iface)
|
||||
iface->get_item = gtk_directory_list_get_item;
|
||||
}
|
||||
|
||||
G_DEFINE_FINAL_TYPE_WITH_CODE (GtkDirectoryList, gtk_directory_list, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, gtk_directory_list_model_init))
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkDirectoryList, gtk_directory_list, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, gtk_directory_list_model_init))
|
||||
|
||||
static void
|
||||
gtk_directory_list_set_property (GObject *object,
|
||||
|
||||
@@ -79,11 +79,11 @@ static GParamSpec *properties[LAST_ARG] = { NULL, };
|
||||
static void gtk_drag_icon_root_init (GtkRootInterface *iface);
|
||||
static void gtk_drag_icon_native_init (GtkNativeInterface *iface);
|
||||
|
||||
G_DEFINE_FINAL_TYPE_WITH_CODE (GtkDragIcon, gtk_drag_icon, GTK_TYPE_WIDGET,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_NATIVE,
|
||||
gtk_drag_icon_native_init)
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_ROOT,
|
||||
gtk_drag_icon_root_init))
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkDragIcon, gtk_drag_icon, GTK_TYPE_WIDGET,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_NATIVE,
|
||||
gtk_drag_icon_native_init)
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_ROOT,
|
||||
gtk_drag_icon_root_init))
|
||||
|
||||
static GdkDisplay *
|
||||
gtk_drag_icon_root_get_display (GtkRoot *self)
|
||||
|
||||
@@ -132,7 +132,7 @@ enum
|
||||
LAST_SIGNAL
|
||||
};
|
||||
|
||||
G_DEFINE_FINAL_TYPE (GtkDropDown, gtk_drop_down, GTK_TYPE_WIDGET)
|
||||
G_DEFINE_TYPE (GtkDropDown, gtk_drop_down, GTK_TYPE_WIDGET)
|
||||
|
||||
static GParamSpec *properties[N_PROPS] = { NULL, };
|
||||
static guint signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
@@ -103,9 +103,9 @@ gtk_editable_label_editable_init (GtkEditableInterface *iface)
|
||||
}
|
||||
|
||||
|
||||
G_DEFINE_FINAL_TYPE_WITH_CODE (GtkEditableLabel, gtk_editable_label, GTK_TYPE_WIDGET,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_EDITABLE,
|
||||
gtk_editable_label_editable_init))
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkEditableLabel, gtk_editable_label, GTK_TYPE_WIDGET,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_EDITABLE,
|
||||
gtk_editable_label_editable_init))
|
||||
|
||||
static void
|
||||
start_editing (GtkWidget *widget,
|
||||
|
||||
@@ -149,8 +149,7 @@ gtk_event_controller_focus_handle_crossing (GtkEventController *controller,
|
||||
double x,
|
||||
double y)
|
||||
{
|
||||
if (crossing->type == GTK_CROSSING_FOCUS ||
|
||||
crossing->type == GTK_CROSSING_ACTIVE)
|
||||
if (crossing->type == GTK_CROSSING_FOCUS)
|
||||
update_focus (controller, crossing);
|
||||
}
|
||||
|
||||
|
||||
@@ -206,9 +206,9 @@ static GParamSpec *native_props[LAST_ARG] = { NULL, };
|
||||
|
||||
static void _gtk_file_chooser_native_iface_init (GtkFileChooserIface *iface);
|
||||
|
||||
G_DEFINE_FINAL_TYPE_WITH_CODE (GtkFileChooserNative, gtk_file_chooser_native, GTK_TYPE_NATIVE_DIALOG,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_FILE_CHOOSER,
|
||||
_gtk_file_chooser_native_iface_init))
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkFileChooserNative, gtk_file_chooser_native, GTK_TYPE_NATIVE_DIALOG,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_FILE_CHOOSER,
|
||||
_gtk_file_chooser_native_iface_init))
|
||||
|
||||
|
||||
/**
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
#include "gtkfilefilterprivate.h"
|
||||
|
||||
#include "macos/gdkmacos.h"
|
||||
#include "macos/gdkmacosdisplay-private.h"
|
||||
#include "macos/gdkmacossurface-private.h"
|
||||
|
||||
typedef struct {
|
||||
@@ -369,9 +368,6 @@ filechooser_quartz_launch (FileChooserQuartzData *data)
|
||||
[data->key_window makeKeyAndOrderFront:nil];
|
||||
}
|
||||
|
||||
/* Need to clear our cached copy of ordered windows */
|
||||
_gdk_macos_display_clear_sorting (GDK_MACOS_DISPLAY (gdk_display_get_default ()));
|
||||
|
||||
if (!data->skip_response)
|
||||
{
|
||||
g_slist_free_full (self->custom_files, g_object_unref);
|
||||
|
||||
@@ -134,8 +134,8 @@ gtk_filter_list_model_model_init (GListModelInterface *iface)
|
||||
iface->get_item = gtk_filter_list_model_get_item;
|
||||
}
|
||||
|
||||
G_DEFINE_FINAL_TYPE_WITH_CODE (GtkFilterListModel, gtk_filter_list_model, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, gtk_filter_list_model_model_init))
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkFilterListModel, gtk_filter_list_model, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, gtk_filter_list_model_model_init))
|
||||
|
||||
static gboolean
|
||||
gtk_filter_list_model_run_filter_on_item (GtkFilterListModel *self,
|
||||
@@ -163,7 +163,7 @@ gtk_filter_list_model_run_filter (GtkFilterListModel *self,
|
||||
gboolean more;
|
||||
|
||||
g_return_if_fail (GTK_IS_FILTER_LIST_MODEL (self));
|
||||
|
||||
|
||||
if (self->pending == NULL)
|
||||
return;
|
||||
|
||||
@@ -346,7 +346,7 @@ gtk_filter_list_model_set_property (GObject *object,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
gtk_filter_list_model_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
@@ -473,7 +473,7 @@ gtk_filter_list_model_refilter (GtkFilterListModel *self,
|
||||
case GTK_FILTER_MATCH_SOME:
|
||||
{
|
||||
GtkBitset *old, *pending;
|
||||
|
||||
|
||||
if (self->matches == NULL)
|
||||
{
|
||||
if (self->strictness == GTK_FILTER_MATCH_ALL)
|
||||
|
||||
@@ -92,7 +92,7 @@ enum
|
||||
|
||||
static GParamSpec *child_props[N_CHILD_PROPERTIES];
|
||||
|
||||
G_DEFINE_FINAL_TYPE (GtkFixedLayoutChild, gtk_fixed_layout_child, GTK_TYPE_LAYOUT_CHILD)
|
||||
G_DEFINE_TYPE (GtkFixedLayoutChild, gtk_fixed_layout_child, GTK_TYPE_LAYOUT_CHILD)
|
||||
|
||||
static void
|
||||
gtk_fixed_layout_child_set_property (GObject *gobject,
|
||||
@@ -215,7 +215,7 @@ gtk_fixed_layout_child_get_transform (GtkFixedLayoutChild *child)
|
||||
return child->transform;
|
||||
}
|
||||
|
||||
G_DEFINE_FINAL_TYPE (GtkFixedLayout, gtk_fixed_layout, GTK_TYPE_LAYOUT_MANAGER)
|
||||
G_DEFINE_TYPE (GtkFixedLayout, gtk_fixed_layout, GTK_TYPE_LAYOUT_MANAGER)
|
||||
|
||||
static GtkSizeRequestMode
|
||||
gtk_fixed_layout_get_request_mode (GtkLayoutManager *layout_manager,
|
||||
|
||||
@@ -198,8 +198,8 @@ gtk_flatten_list_model_model_init (GListModelInterface *iface)
|
||||
iface->get_item = gtk_flatten_list_model_get_item;
|
||||
}
|
||||
|
||||
G_DEFINE_FINAL_TYPE_WITH_CODE (GtkFlattenListModel, gtk_flatten_list_model, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, gtk_flatten_list_model_model_init))
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkFlattenListModel, gtk_flatten_list_model, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, gtk_flatten_list_model_model_init))
|
||||
|
||||
static void
|
||||
gtk_flatten_list_model_items_changed_cb (GListModel *model,
|
||||
@@ -322,7 +322,7 @@ gtk_flatten_list_model_set_property (GObject *object,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
gtk_flatten_list_model_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
@@ -463,7 +463,7 @@ gtk_flatten_list_model_set_model (GtkFlattenListModel *self,
|
||||
if (self->model == model)
|
||||
return;
|
||||
|
||||
removed = g_list_model_get_n_items (G_LIST_MODEL (self));
|
||||
removed = g_list_model_get_n_items (G_LIST_MODEL (self));
|
||||
gtk_flatten_list_clear_model (self);
|
||||
|
||||
self->model = model;
|
||||
|
||||
@@ -84,7 +84,7 @@ enum {
|
||||
|
||||
static GParamSpec *child_props[N_CHILD_PROPERTIES];
|
||||
|
||||
G_DEFINE_FINAL_TYPE (GtkGridLayoutChild, gtk_grid_layout_child, GTK_TYPE_LAYOUT_CHILD)
|
||||
G_DEFINE_TYPE (GtkGridLayoutChild, gtk_grid_layout_child, GTK_TYPE_LAYOUT_CHILD)
|
||||
|
||||
static void
|
||||
gtk_grid_layout_child_set_property (GObject *gobject,
|
||||
@@ -454,7 +454,7 @@ enum {
|
||||
|
||||
static GParamSpec *layout_props[N_PROPERTIES];
|
||||
|
||||
G_DEFINE_FINAL_TYPE (GtkGridLayout, gtk_grid_layout, GTK_TYPE_LAYOUT_MANAGER)
|
||||
G_DEFINE_TYPE (GtkGridLayout, gtk_grid_layout, GTK_TYPE_LAYOUT_MANAGER)
|
||||
|
||||
static inline GtkGridLayoutChild *
|
||||
get_grid_child (GtkGridLayout *self,
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
* maximize and close buttons, or the window icon.
|
||||
*
|
||||
* For these reasons, `GtkHeaderBar` is the natural choice for use as the
|
||||
* custom titlebar widget of a `GtkWindow` (see [method@Gtk.Window.set_titlebar]),
|
||||
* custom titlebar widget of a `GtkWindow (see [method@Gtk.Window.set_titlebar]),
|
||||
* as it gives features typical of titlebars while allowing the addition of
|
||||
* child widgets.
|
||||
*
|
||||
|
||||
@@ -357,7 +357,7 @@ notify_cursor_location (GtkIMContextWayland *context)
|
||||
{
|
||||
GtkIMContextWaylandGlobal *global;
|
||||
cairo_rectangle_int_t rect;
|
||||
double x, y, sx, sy;
|
||||
double x, y;
|
||||
|
||||
global = gtk_im_context_wayland_get_global (context);
|
||||
if (global == NULL)
|
||||
@@ -369,11 +369,8 @@ notify_cursor_location (GtkIMContextWayland *context)
|
||||
rect.x, rect.y,
|
||||
&x, &y);
|
||||
|
||||
gtk_native_get_surface_transform (gtk_widget_get_native (context->widget),
|
||||
&sx, &sy);
|
||||
|
||||
rect.x = x + sx;
|
||||
rect.y = y + sy;
|
||||
rect.x = x;
|
||||
rect.y = y;
|
||||
zwp_text_input_v3_set_cursor_rectangle (global->text_input,
|
||||
rect.x, rect.y,
|
||||
rect.width, rect.height);
|
||||
|
||||
@@ -147,7 +147,7 @@ static guint
|
||||
gtk_map_list_model_get_n_items (GListModel *list)
|
||||
{
|
||||
GtkMapListModel *self = GTK_MAP_LIST_MODEL (list);
|
||||
|
||||
|
||||
if (self->model == NULL)
|
||||
return 0;
|
||||
|
||||
@@ -205,8 +205,8 @@ gtk_map_list_model_model_init (GListModelInterface *iface)
|
||||
iface->get_item = gtk_map_list_model_get_item;
|
||||
}
|
||||
|
||||
G_DEFINE_FINAL_TYPE_WITH_CODE (GtkMapListModel, gtk_map_list_model, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, gtk_map_list_model_model_init))
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkMapListModel, gtk_map_list_model, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, gtk_map_list_model_model_init))
|
||||
|
||||
static void
|
||||
gtk_map_list_model_items_changed_cb (GListModel *model,
|
||||
@@ -291,7 +291,7 @@ gtk_map_list_model_set_property (GObject *object,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
gtk_map_list_model_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
@@ -527,7 +527,7 @@ gtk_map_list_model_set_map_func (GtkMapListModel *self,
|
||||
self->map_func = map_func;
|
||||
self->user_data = user_data;
|
||||
self->user_destroy = user_destroy;
|
||||
|
||||
|
||||
gtk_map_list_model_init_items (self);
|
||||
|
||||
if (self->model)
|
||||
@@ -579,7 +579,7 @@ gtk_map_list_model_set_model (GtkMapListModel *self,
|
||||
}
|
||||
|
||||
gtk_map_list_model_init_items (self);
|
||||
|
||||
|
||||
if (removed > 0 || added > 0)
|
||||
g_list_model_items_changed (G_LIST_MODEL (self), 0, removed, added);
|
||||
|
||||
|
||||
@@ -62,7 +62,7 @@ enum
|
||||
N_PROPS
|
||||
};
|
||||
|
||||
G_DEFINE_FINAL_TYPE (GtkMediaControls, gtk_media_controls, GTK_TYPE_WIDGET)
|
||||
G_DEFINE_TYPE (GtkMediaControls, gtk_media_controls, GTK_TYPE_WIDGET)
|
||||
|
||||
static GParamSpec *properties[N_PROPS] = { NULL, };
|
||||
|
||||
@@ -138,7 +138,7 @@ time_adjustment_changed (GtkAdjustment *adjustment,
|
||||
if (gtk_adjustment_get_value (adjustment) == (double) gtk_media_stream_get_timestamp (controls->stream) / G_USEC_PER_SEC)
|
||||
return;
|
||||
|
||||
gtk_media_stream_seek (controls->stream,
|
||||
gtk_media_stream_seek (controls->stream,
|
||||
gtk_adjustment_get_value (adjustment) * G_USEC_PER_SEC + 0.5);
|
||||
}
|
||||
|
||||
|
||||
@@ -201,11 +201,11 @@ gtk_multi_selection_selection_model_init (GtkSelectionModelInterface *iface)
|
||||
iface->set_selection = gtk_multi_selection_set_selection;
|
||||
}
|
||||
|
||||
G_DEFINE_FINAL_TYPE_WITH_CODE (GtkMultiSelection, gtk_multi_selection, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL,
|
||||
gtk_multi_selection_list_model_init)
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_SELECTION_MODEL,
|
||||
gtk_multi_selection_selection_model_init))
|
||||
G_DEFINE_TYPE_EXTENDED (GtkMultiSelection, gtk_multi_selection, G_TYPE_OBJECT, 0,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL,
|
||||
gtk_multi_selection_list_model_init)
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_SELECTION_MODEL,
|
||||
gtk_multi_selection_selection_model_init))
|
||||
|
||||
static void
|
||||
gtk_multi_selection_items_changed_cb (GListModel *model,
|
||||
|
||||
@@ -240,9 +240,9 @@ gtk_multi_sorter_buildable_init (GtkBuildableIface *iface)
|
||||
iface->add_child = gtk_multi_sorter_buildable_add_child;
|
||||
}
|
||||
|
||||
G_DEFINE_FINAL_TYPE_WITH_CODE (GtkMultiSorter, gtk_multi_sorter, GTK_TYPE_SORTER,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, gtk_multi_sorter_list_model_init)
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE, gtk_multi_sorter_buildable_init))
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkMultiSorter, gtk_multi_sorter, GTK_TYPE_SORTER,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, gtk_multi_sorter_list_model_init)
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE, gtk_multi_sorter_buildable_init))
|
||||
|
||||
static GtkOrdering
|
||||
gtk_multi_sorter_compare (GtkSorter *sorter,
|
||||
|
||||
@@ -113,11 +113,11 @@ gtk_no_selection_selection_model_init (GtkSelectionModelInterface *iface)
|
||||
iface->get_selection_in_range = gtk_no_selection_get_selection_in_range;
|
||||
}
|
||||
|
||||
G_DEFINE_FINAL_TYPE_WITH_CODE (GtkNoSelection, gtk_no_selection, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL,
|
||||
gtk_no_selection_list_model_init)
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_SELECTION_MODEL,
|
||||
gtk_no_selection_selection_model_init))
|
||||
G_DEFINE_TYPE_EXTENDED (GtkNoSelection, gtk_no_selection, G_TYPE_OBJECT, 0,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL,
|
||||
gtk_no_selection_list_model_init)
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_SELECTION_MODEL,
|
||||
gtk_no_selection_selection_model_init))
|
||||
|
||||
static void
|
||||
gtk_no_selection_clear_model (GtkNoSelection *self)
|
||||
@@ -125,7 +125,7 @@ gtk_no_selection_clear_model (GtkNoSelection *self)
|
||||
if (self->model == NULL)
|
||||
return;
|
||||
|
||||
g_signal_handlers_disconnect_by_func (self->model,
|
||||
g_signal_handlers_disconnect_by_func (self->model,
|
||||
g_list_model_items_changed,
|
||||
self);
|
||||
g_clear_object (&self->model);
|
||||
|
||||
@@ -52,7 +52,7 @@ enum {
|
||||
NUM_PROPERTIES
|
||||
};
|
||||
|
||||
G_DEFINE_FINAL_TYPE (GtkNumericSorter, gtk_numeric_sorter, GTK_TYPE_SORTER)
|
||||
G_DEFINE_TYPE (GtkNumericSorter, gtk_numeric_sorter, GTK_TYPE_SORTER)
|
||||
|
||||
static GParamSpec *properties[NUM_PROPERTIES] = { NULL, };
|
||||
|
||||
@@ -491,7 +491,7 @@ gtk_numeric_sorter_set_property (GObject *object,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
gtk_numeric_sorter_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
|
||||
@@ -72,7 +72,7 @@ enum
|
||||
|
||||
static GParamSpec *child_props[N_CHILD_PROPERTIES];
|
||||
|
||||
G_DEFINE_FINAL_TYPE (GtkOverlayLayoutChild, gtk_overlay_layout_child, GTK_TYPE_LAYOUT_CHILD)
|
||||
G_DEFINE_TYPE (GtkOverlayLayoutChild, gtk_overlay_layout_child, GTK_TYPE_LAYOUT_CHILD)
|
||||
|
||||
static void
|
||||
gtk_overlay_layout_child_set_property (GObject *gobject,
|
||||
@@ -247,7 +247,7 @@ gtk_overlay_layout_child_get_clip_overlay (GtkOverlayLayoutChild *child)
|
||||
return child->clip_overlay;
|
||||
}
|
||||
|
||||
G_DEFINE_FINAL_TYPE (GtkOverlayLayout, gtk_overlay_layout, GTK_TYPE_LAYOUT_MANAGER)
|
||||
G_DEFINE_TYPE (GtkOverlayLayout, gtk_overlay_layout, GTK_TYPE_LAYOUT_MANAGER)
|
||||
|
||||
static void
|
||||
gtk_overlay_layout_measure (GtkLayoutManager *layout_manager,
|
||||
|
||||
@@ -104,7 +104,7 @@ enum {
|
||||
PROP_ACTIVATES_DEFAULT,
|
||||
PROP_SHOW_PEEK_ICON,
|
||||
PROP_EXTRA_MENU,
|
||||
NUM_PROPERTIES
|
||||
NUM_PROPERTIES
|
||||
};
|
||||
|
||||
static GParamSpec *props[NUM_PROPERTIES] = { NULL, };
|
||||
@@ -112,9 +112,9 @@ static GParamSpec *props[NUM_PROPERTIES] = { NULL, };
|
||||
static void gtk_password_entry_editable_init (GtkEditableInterface *iface);
|
||||
static void gtk_password_entry_accessible_init (GtkAccessibleInterface *iface);
|
||||
|
||||
G_DEFINE_FINAL_TYPE_WITH_CODE (GtkPasswordEntry, gtk_password_entry, GTK_TYPE_WIDGET,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_ACCESSIBLE, gtk_password_entry_accessible_init)
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_EDITABLE, gtk_password_entry_editable_init))
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkPasswordEntry, gtk_password_entry, GTK_TYPE_WIDGET,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_ACCESSIBLE, gtk_password_entry_accessible_init)
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_EDITABLE, gtk_password_entry_editable_init))
|
||||
|
||||
static void
|
||||
caps_lock_state_changed (GdkDevice *device,
|
||||
|
||||
@@ -29,10 +29,15 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
#define GTK_TYPE_PASSWORD_ENTRY (gtk_password_entry_get_type ())
|
||||
#define GTK_TYPE_PASSWORD_ENTRY (gtk_password_entry_get_type ())
|
||||
#define GTK_PASSWORD_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_PASSWORD_ENTRY, GtkPasswordEntry))
|
||||
#define GTK_IS_PASSWORD_ENTRY(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_PASSWORD_ENTRY))
|
||||
|
||||
typedef struct _GtkPasswordEntry GtkPasswordEntry;
|
||||
typedef struct _GtkPasswordEntryClass GtkPasswordEntryClass;
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
G_DECLARE_FINAL_TYPE (GtkPasswordEntry, gtk_password_entry, GTK, PASSWORD_ENTRY, GtkWidget)
|
||||
GType gtk_password_entry_get_type (void) G_GNUC_CONST;
|
||||
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GtkWidget * gtk_password_entry_new (void);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
/* gtkpasswordentrybuffer.c: Entry buffer with secure allocation
|
||||
/* gtkpasswordentrybuffer.c: Entry buffer with secure allocation
|
||||
*
|
||||
Copyright 2009 Stefan Walter
|
||||
* Copyright 2020 GNOME Foundation
|
||||
@@ -50,7 +50,7 @@ struct _GtkPasswordEntryBuffer
|
||||
guint text_chars;
|
||||
};
|
||||
|
||||
G_DEFINE_FINAL_TYPE (GtkPasswordEntryBuffer, gtk_password_entry_buffer, GTK_TYPE_ENTRY_BUFFER)
|
||||
G_DEFINE_TYPE (GtkPasswordEntryBuffer, gtk_password_entry_buffer, GTK_TYPE_ENTRY_BUFFER)
|
||||
|
||||
static const char *
|
||||
gtk_password_entry_buffer_real_get_text (GtkEntryBuffer *buffer,
|
||||
|
||||
@@ -111,7 +111,7 @@ struct _GtkPictureClass
|
||||
|
||||
static GParamSpec *properties[NUM_PROPERTIES] = { NULL, };
|
||||
|
||||
G_DEFINE_FINAL_TYPE (GtkPicture, gtk_picture, GTK_TYPE_WIDGET)
|
||||
G_DEFINE_TYPE (GtkPicture, gtk_picture, GTK_TYPE_WIDGET)
|
||||
|
||||
static void
|
||||
gtk_picture_snapshot (GtkWidget *widget,
|
||||
|
||||
@@ -921,8 +921,7 @@ create_cloud_provider_account_row (GtkPlacesSidebar *sidebar,
|
||||
|
||||
g_free (tooltip);
|
||||
g_free (mount_uri);
|
||||
g_clear_object (&end_icon);
|
||||
|
||||
g_object_unref (end_icon);
|
||||
return TRUE;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -106,7 +106,6 @@ enum {
|
||||
PROP_0,
|
||||
PROP_PLACEHOLDER_TEXT,
|
||||
PROP_ACTIVATES_DEFAULT,
|
||||
PROP_SEARCH_DELAY,
|
||||
NUM_PROPERTIES,
|
||||
};
|
||||
|
||||
@@ -123,8 +122,6 @@ struct _GtkSearchEntry
|
||||
GtkWidget *capture_widget;
|
||||
GtkEventController *capture_widget_controller;
|
||||
|
||||
guint search_delay;
|
||||
|
||||
GtkWidget *entry;
|
||||
GtkWidget *icon;
|
||||
|
||||
@@ -153,6 +150,9 @@ G_DEFINE_TYPE_WITH_CODE (GtkSearchEntry, gtk_search_entry, GTK_TYPE_WIDGET,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_EDITABLE,
|
||||
gtk_search_entry_editable_init))
|
||||
|
||||
/* 150 mseconds of delay */
|
||||
#define DELAYED_TIMEOUT_ID 150
|
||||
|
||||
static void
|
||||
text_changed (GtkSearchEntry *entry)
|
||||
{
|
||||
@@ -224,10 +224,6 @@ gtk_search_entry_set_property (GObject *object,
|
||||
}
|
||||
break;
|
||||
|
||||
case PROP_SEARCH_DELAY:
|
||||
gtk_search_entry_set_search_delay (entry, g_value_get_uint (value));
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
}
|
||||
@@ -254,10 +250,6 @@ gtk_search_entry_get_property (GObject *object,
|
||||
g_value_set_boolean (value, gtk_text_get_activates_default (GTK_TEXT (entry->entry)));
|
||||
break;
|
||||
|
||||
case PROP_SEARCH_DELAY:
|
||||
g_value_set_uint (value, entry->search_delay);
|
||||
break;
|
||||
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
|
||||
}
|
||||
@@ -323,19 +315,6 @@ gtk_search_entry_class_init (GtkSearchEntryClass *klass)
|
||||
FALSE,
|
||||
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
|
||||
|
||||
/**
|
||||
* GtkSearchEntry:search-delay:
|
||||
*
|
||||
* The delay in milliseconds from last keypress to the search
|
||||
* changed signal.
|
||||
*/
|
||||
props[PROP_SEARCH_DELAY] =
|
||||
g_param_spec_uint ("search-delay",
|
||||
P_("Search delay"),
|
||||
P_("The delay from last keypress to the search-changed signal. If this is not set, it defaults to 150ms"),
|
||||
0, G_MAXUINT, 150,
|
||||
GTK_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY);
|
||||
|
||||
g_object_class_install_properties (object_class, NUM_PROPERTIES, props);
|
||||
gtk_editable_install_properties (object_class, NUM_PROPERTIES);
|
||||
|
||||
@@ -360,9 +339,8 @@ gtk_search_entry_class_init (GtkSearchEntryClass *klass)
|
||||
* GtkSearchEntry::search-changed:
|
||||
* @entry: the entry on which the signal was emitted
|
||||
*
|
||||
* Emitted with a delay. The length of the delay can be
|
||||
* changed with the [property@Gtk.SearchEntry:search-delay]
|
||||
* property.
|
||||
* Emitted with a short delay of 150 milliseconds after the
|
||||
* last change to the entry text.
|
||||
*/
|
||||
signals[SEARCH_CHANGED] =
|
||||
g_signal_new (I_("search-changed"),
|
||||
@@ -548,7 +526,7 @@ reset_timeout (GtkSearchEntry *entry)
|
||||
{
|
||||
if (entry->delayed_changed_id > 0)
|
||||
g_source_remove (entry->delayed_changed_id);
|
||||
entry->delayed_changed_id = g_timeout_add (entry->search_delay,
|
||||
entry->delayed_changed_id = g_timeout_add (DELAYED_TIMEOUT_ID,
|
||||
gtk_search_entry_changed_timeout_cb,
|
||||
entry);
|
||||
gdk_source_set_static_name_by_id (entry->delayed_changed_id, "[gtk] gtk_search_entry_changed_timeout_cb");
|
||||
@@ -617,8 +595,6 @@ gtk_search_entry_init (GtkSearchEntry *entry)
|
||||
GtkWidget *icon;
|
||||
GtkGesture *press, *catchall;
|
||||
|
||||
entry->search_delay = 150;
|
||||
|
||||
/* The search icon is purely presentational */
|
||||
icon = g_object_new (GTK_TYPE_IMAGE,
|
||||
"accessible-role", GTK_ACCESSIBLE_ROLE_PRESENTATION,
|
||||
@@ -797,52 +773,6 @@ gtk_search_entry_get_key_capture_widget (GtkSearchEntry *entry)
|
||||
return entry->capture_widget;
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_search_entry_set_searcH-delay:
|
||||
* @entry: a `GtkSearchEntry`
|
||||
* @delay: a delay in milliseconds
|
||||
*
|
||||
* Set the delay to be used between the last keypress and the
|
||||
* [signal@Gtk.SearchEntry::search-changed] signal being emitted.
|
||||
*
|
||||
* Since: 4.8
|
||||
*/
|
||||
void
|
||||
gtk_search_entry_set_search_delay (GtkSearchEntry *entry,
|
||||
guint delay)
|
||||
{
|
||||
g_return_if_fail (GTK_IS_SEARCH_ENTRY (entry));
|
||||
|
||||
if (entry->search_delay == delay)
|
||||
return;
|
||||
|
||||
entry->search_delay = delay;
|
||||
|
||||
/* Apply the updated timeout */
|
||||
reset_timeout (entry);
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (entry), props[PROP_SEARCH_DELAY]);
|
||||
}
|
||||
|
||||
/**
|
||||
* gtk_search_entry_get_search_delay
|
||||
* @entry: a `GtkSearchEntry`
|
||||
*
|
||||
* Get the delay to be used between the last keypress and the
|
||||
* [signal@Gtk.SearchEntry::search-changed] signal being emitted.
|
||||
*
|
||||
* Returns: a delay in milliseconds.
|
||||
*
|
||||
* Since: 4.8
|
||||
*/
|
||||
guint
|
||||
gtk_search_entry_get_search_delay (GtkSearchEntry *entry)
|
||||
{
|
||||
g_return_val_if_fail (GTK_IS_SEARCH_ENTRY (entry), 0);
|
||||
|
||||
return entry->search_delay;
|
||||
}
|
||||
|
||||
GtkEventController *
|
||||
gtk_search_entry_get_key_controller (GtkSearchEntry *entry)
|
||||
{
|
||||
|
||||
@@ -54,11 +54,6 @@ void gtk_search_entry_set_key_capture_widget (GtkSearchEntry *entry,
|
||||
GDK_AVAILABLE_IN_ALL
|
||||
GtkWidget* gtk_search_entry_get_key_capture_widget (GtkSearchEntry *entry);
|
||||
|
||||
GDK_AVAILABLE_IN_4_8
|
||||
void gtk_search_entry_set_search_delay (GtkSearchEntry *entry,
|
||||
guint delay);
|
||||
GDK_AVAILABLE_IN_4_8
|
||||
guint gtk_search_entry_get_search_delay (GtkSearchEntry *entry);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
@@ -95,8 +95,8 @@ gtk_selection_filter_model_list_model_init (GListModelInterface *iface)
|
||||
iface->get_item = gtk_selection_filter_model_get_item;
|
||||
}
|
||||
|
||||
G_DEFINE_FINAL_TYPE_WITH_CODE (GtkSelectionFilterModel, gtk_selection_filter_model, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, gtk_selection_filter_model_list_model_init))
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkSelectionFilterModel, gtk_selection_filter_model, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, gtk_selection_filter_model_list_model_init))
|
||||
|
||||
static void
|
||||
selection_filter_model_items_changed (GtkSelectionFilterModel *self,
|
||||
|
||||
@@ -65,7 +65,7 @@ enum
|
||||
N_PROPS
|
||||
};
|
||||
|
||||
G_DEFINE_FINAL_TYPE (GtkShortcut, gtk_shortcut, G_TYPE_OBJECT)
|
||||
G_DEFINE_TYPE (GtkShortcut, gtk_shortcut, G_TYPE_OBJECT)
|
||||
|
||||
static GParamSpec *properties[N_PROPS] = { NULL, };
|
||||
|
||||
@@ -387,7 +387,7 @@ gtk_shortcut_set_arguments (GtkShortcut *self,
|
||||
|
||||
if (self->args == args)
|
||||
return;
|
||||
|
||||
|
||||
g_clear_pointer (&self->args, g_variant_unref);
|
||||
if (args)
|
||||
self->args = g_variant_ref_sink (args);
|
||||
|
||||
@@ -157,17 +157,17 @@ gtk_single_selection_unselect_item (GtkSelectionModel *model,
|
||||
static void
|
||||
gtk_single_selection_selection_model_init (GtkSelectionModelInterface *iface)
|
||||
{
|
||||
iface->is_selected = gtk_single_selection_is_selected;
|
||||
iface->get_selection_in_range = gtk_single_selection_get_selection_in_range;
|
||||
iface->select_item = gtk_single_selection_select_item;
|
||||
iface->unselect_item = gtk_single_selection_unselect_item;
|
||||
iface->is_selected = gtk_single_selection_is_selected;
|
||||
iface->get_selection_in_range = gtk_single_selection_get_selection_in_range;
|
||||
iface->select_item = gtk_single_selection_select_item;
|
||||
iface->unselect_item = gtk_single_selection_unselect_item;
|
||||
}
|
||||
|
||||
G_DEFINE_FINAL_TYPE_WITH_CODE (GtkSingleSelection, gtk_single_selection, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL,
|
||||
gtk_single_selection_list_model_init)
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_SELECTION_MODEL,
|
||||
gtk_single_selection_selection_model_init))
|
||||
G_DEFINE_TYPE_EXTENDED (GtkSingleSelection, gtk_single_selection, G_TYPE_OBJECT, 0,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL,
|
||||
gtk_single_selection_list_model_init)
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_SELECTION_MODEL,
|
||||
gtk_single_selection_selection_model_init))
|
||||
|
||||
static void
|
||||
gtk_single_selection_items_changed_cb (GListModel *model,
|
||||
@@ -281,7 +281,7 @@ gtk_single_selection_clear_model (GtkSingleSelection *self)
|
||||
if (self->model == NULL)
|
||||
return;
|
||||
|
||||
g_signal_handlers_disconnect_by_func (self->model,
|
||||
g_signal_handlers_disconnect_by_func (self->model,
|
||||
gtk_single_selection_items_changed_cb,
|
||||
self);
|
||||
g_clear_object (&self->model);
|
||||
@@ -510,7 +510,7 @@ gtk_single_selection_set_model (GtkSingleSelection *self,
|
||||
return;
|
||||
|
||||
g_object_freeze_notify (G_OBJECT (self));
|
||||
|
||||
|
||||
n_items_before = self->model ? g_list_model_get_n_items (self->model) : 0;
|
||||
gtk_single_selection_clear_model (self);
|
||||
|
||||
@@ -674,7 +674,7 @@ gtk_single_selection_set_autoselect (GtkSingleSelection *self,
|
||||
self->autoselect = autoselect;
|
||||
|
||||
g_object_freeze_notify (G_OBJECT (self));
|
||||
|
||||
|
||||
g_object_notify_by_pspec (G_OBJECT (self), properties[PROP_AUTOSELECT]);
|
||||
|
||||
if (self->autoselect && !self->selected_item)
|
||||
|
||||
@@ -73,7 +73,7 @@ gtk_slice_list_model_get_n_items (GListModel *list)
|
||||
{
|
||||
GtkSliceListModel *self = GTK_SLICE_LIST_MODEL (list);
|
||||
guint n_items;
|
||||
|
||||
|
||||
if (self->model == NULL)
|
||||
return 0;
|
||||
|
||||
@@ -110,8 +110,8 @@ gtk_slice_list_model_model_init (GListModelInterface *iface)
|
||||
iface->get_item = gtk_slice_list_model_get_item;
|
||||
}
|
||||
|
||||
G_DEFINE_FINAL_TYPE_WITH_CODE (GtkSliceListModel, gtk_slice_list_model, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, gtk_slice_list_model_model_init))
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkSliceListModel, gtk_slice_list_model, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, gtk_slice_list_model_model_init))
|
||||
|
||||
static void
|
||||
gtk_slice_list_model_items_changed_cb (GListModel *model,
|
||||
@@ -193,7 +193,7 @@ gtk_slice_list_model_set_property (GObject *object,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
gtk_slice_list_model_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
|
||||
@@ -173,8 +173,8 @@ gtk_sort_list_model_model_init (GListModelInterface *iface)
|
||||
iface->get_item = gtk_sort_list_model_get_item;
|
||||
}
|
||||
|
||||
G_DEFINE_FINAL_TYPE_WITH_CODE (GtkSortListModel, gtk_sort_list_model, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, gtk_sort_list_model_model_init))
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkSortListModel, gtk_sort_list_model, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, gtk_sort_list_model_model_init))
|
||||
|
||||
static gboolean
|
||||
gtk_sort_list_model_is_sorting (GtkSortListModel *self)
|
||||
@@ -253,7 +253,7 @@ gtk_sort_list_model_sort_step (GtkSortListModel *self,
|
||||
start_change = MIN (start_change, (gpointer *) change.base);
|
||||
end_change = MAX (end_change, ((gpointer *) change.base) + change.len);
|
||||
}
|
||||
|
||||
|
||||
if (g_get_monotonic_time () >= end_time && !finish)
|
||||
break;
|
||||
}
|
||||
@@ -419,7 +419,7 @@ gtk_sort_list_model_clear_items (GtkSortListModel *self,
|
||||
g_clear_pointer (&self->positions, g_free);
|
||||
|
||||
gtk_sort_list_model_clear_keys (self);
|
||||
}
|
||||
}
|
||||
|
||||
static gboolean
|
||||
gtk_sort_list_model_should_sort (GtkSortListModel *self)
|
||||
@@ -478,7 +478,7 @@ gtk_sort_list_model_update_items (GtkSortListModel *self,
|
||||
n_items = self->n_items;
|
||||
start = n_items;
|
||||
end = n_items;
|
||||
|
||||
|
||||
/* first, move the keys over */
|
||||
old_keys = self->keys;
|
||||
gtk_sort_list_model_clear_sort_keys (self, position, removed);
|
||||
@@ -523,7 +523,7 @@ gtk_sort_list_model_update_items (GtkSortListModel *self,
|
||||
if (pos >= position + removed)
|
||||
pos = pos - removed + added;
|
||||
else if (pos >= position)
|
||||
{
|
||||
{
|
||||
start = MIN (start, valid);
|
||||
end = n_items - i - 1;
|
||||
continue;
|
||||
@@ -650,7 +650,7 @@ gtk_sort_list_model_set_property (GObject *object,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
gtk_sort_list_model_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
@@ -903,7 +903,7 @@ gtk_sort_list_model_set_model (GtkSortListModel *self,
|
||||
gtk_sort_list_model_finish_sorting (self, &ignore1, &ignore2);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (removed > 0 || self->n_items > 0)
|
||||
g_list_model_items_changed (G_LIST_MODEL (self), 0, removed, self->n_items);
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ enum {
|
||||
NUM_PROPERTIES
|
||||
};
|
||||
|
||||
G_DEFINE_FINAL_TYPE (GtkStringFilter, gtk_string_filter, GTK_TYPE_FILTER)
|
||||
G_DEFINE_TYPE (GtkStringFilter, gtk_string_filter, GTK_TYPE_FILTER)
|
||||
|
||||
static GParamSpec *properties[NUM_PROPERTIES] = { NULL, };
|
||||
|
||||
@@ -190,7 +190,7 @@ gtk_string_filter_set_property (GObject *object,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
gtk_string_filter_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
|
||||
@@ -83,7 +83,7 @@ enum {
|
||||
PROP_NUM_PROPERTIES
|
||||
};
|
||||
|
||||
G_DEFINE_FINAL_TYPE (GtkStringObject, gtk_string_object, G_TYPE_OBJECT)
|
||||
G_DEFINE_TYPE (GtkStringObject, gtk_string_object, G_TYPE_OBJECT);
|
||||
|
||||
static void
|
||||
gtk_string_object_init (GtkStringObject *object)
|
||||
@@ -395,11 +395,11 @@ gtk_string_list_buildable_init (GtkBuildableIface *iface)
|
||||
iface->custom_finished = gtk_string_list_buildable_custom_finished;
|
||||
}
|
||||
|
||||
G_DEFINE_FINAL_TYPE_WITH_CODE (GtkStringList, gtk_string_list, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
|
||||
gtk_string_list_buildable_init)
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL,
|
||||
gtk_string_list_model_init))
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkStringList, gtk_string_list, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE,
|
||||
gtk_string_list_buildable_init)
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL,
|
||||
gtk_string_list_model_init))
|
||||
|
||||
static void
|
||||
gtk_string_list_dispose (GObject *object)
|
||||
|
||||
@@ -54,7 +54,7 @@ enum {
|
||||
NUM_PROPERTIES
|
||||
};
|
||||
|
||||
G_DEFINE_FINAL_TYPE (GtkStringSorter, gtk_string_sorter, GTK_TYPE_SORTER)
|
||||
G_DEFINE_TYPE (GtkStringSorter, gtk_string_sorter, GTK_TYPE_SORTER)
|
||||
|
||||
static GParamSpec *properties[NUM_PROPERTIES] = { NULL, };
|
||||
|
||||
@@ -238,7 +238,7 @@ gtk_string_sorter_set_property (GObject *object,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
gtk_string_sorter_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
|
||||
@@ -181,7 +181,6 @@ struct _GtkTextPrivate
|
||||
|
||||
GtkGesture *drag_gesture;
|
||||
GtkEventController *key_controller;
|
||||
GtkEventController *focus_controller;
|
||||
|
||||
GtkCssNode *selection_node;
|
||||
GtkCssNode *block_cursor_node;
|
||||
@@ -530,7 +529,6 @@ static void gtk_text_schedule_im_reset (GtkText *self);
|
||||
static gboolean gtk_text_mnemonic_activate (GtkWidget *widget,
|
||||
gboolean group_cycling);
|
||||
static void gtk_text_check_cursor_blink (GtkText *self);
|
||||
static void remove_blink_timeout (GtkText *self);
|
||||
static void gtk_text_pend_cursor_blink (GtkText *self);
|
||||
static void gtk_text_reset_blink_time (GtkText *self);
|
||||
static void gtk_text_update_cached_style_values(GtkText *self);
|
||||
@@ -1951,11 +1949,11 @@ gtk_text_init (GtkText *self)
|
||||
priv->im_context);
|
||||
gtk_widget_add_controller (GTK_WIDGET (self), priv->key_controller);
|
||||
|
||||
priv->focus_controller = gtk_event_controller_focus_new ();
|
||||
gtk_event_controller_set_name (priv->focus_controller, "gtk-text-focus-controller");
|
||||
g_signal_connect (priv->focus_controller, "notify::is-focus",
|
||||
controller = gtk_event_controller_focus_new ();
|
||||
gtk_event_controller_set_name (controller, "gtk-text-focus-controller");
|
||||
g_signal_connect (controller, "notify::is-focus",
|
||||
G_CALLBACK (gtk_text_focus_changed), self);
|
||||
gtk_widget_add_controller (GTK_WIDGET (self), priv->focus_controller);
|
||||
gtk_widget_add_controller (GTK_WIDGET (self), controller);
|
||||
|
||||
widget_node = gtk_widget_get_css_node (GTK_WIDGET (self));
|
||||
for (i = 0; i < 2; i++)
|
||||
@@ -3263,7 +3261,6 @@ gtk_text_focus_changed (GtkEventControllerFocus *controller,
|
||||
|
||||
gtk_text_im_set_focus_in (self);
|
||||
gtk_text_reset_blink_time (self);
|
||||
gtk_text_check_cursor_blink (self);
|
||||
}
|
||||
else /* Focus out */
|
||||
{
|
||||
@@ -3280,10 +3277,9 @@ gtk_text_focus_changed (GtkEventControllerFocus *controller,
|
||||
gtk_text_schedule_im_reset (self);
|
||||
gtk_im_context_focus_out (priv->im_context);
|
||||
}
|
||||
|
||||
if (priv->blink_tick)
|
||||
remove_blink_timeout (self);
|
||||
}
|
||||
|
||||
gtk_text_check_cursor_blink (self);
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -6430,7 +6426,7 @@ cursor_blinks (GtkText *self)
|
||||
{
|
||||
GtkTextPrivate *priv = gtk_text_get_instance_private (self);
|
||||
|
||||
if (gtk_event_controller_focus_is_focus (GTK_EVENT_CONTROLLER_FOCUS (priv->focus_controller)) &&
|
||||
if (gtk_widget_has_focus (GTK_WIDGET (self)) &&
|
||||
priv->editable &&
|
||||
priv->selection_bound == priv->current_pos)
|
||||
{
|
||||
|
||||
@@ -101,7 +101,7 @@ enum
|
||||
N_PROPS
|
||||
};
|
||||
|
||||
G_DEFINE_FINAL_TYPE (GtkTreeExpander, gtk_tree_expander, GTK_TYPE_WIDGET)
|
||||
G_DEFINE_TYPE (GtkTreeExpander, gtk_tree_expander, GTK_TYPE_WIDGET)
|
||||
|
||||
static GParamSpec *properties[N_PROPS] = { NULL, };
|
||||
|
||||
|
||||
@@ -165,7 +165,7 @@ tree_node_get_local_position (GtkRbTree *tree,
|
||||
TreeNode *left, *parent;
|
||||
TreeAugment *left_aug;
|
||||
guint n;
|
||||
|
||||
|
||||
left = gtk_rb_tree_node_get_left (node);
|
||||
if (left)
|
||||
{
|
||||
@@ -209,7 +209,7 @@ tree_node_get_position (TreeNode *node)
|
||||
TreeNode *left, *parent;
|
||||
TreeAugment *left_aug;
|
||||
guint n;
|
||||
|
||||
|
||||
for (n = 0;
|
||||
!node->is_root;
|
||||
node = node->parent, n++)
|
||||
@@ -520,7 +520,7 @@ gtk_tree_list_model_expand_node (GtkTreeListModel *self,
|
||||
|
||||
if (node->empty)
|
||||
return 0;
|
||||
|
||||
|
||||
if (node->model != NULL)
|
||||
return 0;
|
||||
|
||||
@@ -528,18 +528,18 @@ gtk_tree_list_model_expand_node (GtkTreeListModel *self,
|
||||
|
||||
if (model == NULL)
|
||||
return 0;
|
||||
|
||||
|
||||
gtk_tree_list_model_init_node (self, node, model);
|
||||
|
||||
tree_node_mark_dirty (node);
|
||||
|
||||
|
||||
return tree_node_get_n_children (node);
|
||||
}
|
||||
|
||||
static guint
|
||||
gtk_tree_list_model_collapse_node (GtkTreeListModel *self,
|
||||
TreeNode *node)
|
||||
{
|
||||
{
|
||||
guint n_items;
|
||||
|
||||
if (node->model == NULL)
|
||||
@@ -604,8 +604,8 @@ gtk_tree_list_model_model_init (GListModelInterface *iface)
|
||||
iface->get_item = gtk_tree_list_model_get_item;
|
||||
}
|
||||
|
||||
G_DEFINE_FINAL_TYPE_WITH_CODE (GtkTreeListModel, gtk_tree_list_model, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, gtk_tree_list_model_model_init))
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkTreeListModel, gtk_tree_list_model, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (G_TYPE_LIST_MODEL, gtk_tree_list_model_model_init))
|
||||
|
||||
static void
|
||||
gtk_tree_list_model_set_property (GObject *object,
|
||||
@@ -631,7 +631,7 @@ gtk_tree_list_model_set_property (GObject *object,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
gtk_tree_list_model_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
@@ -956,7 +956,7 @@ enum {
|
||||
|
||||
static GParamSpec *row_properties[NUM_ROW_PROPERTIES] = { NULL, };
|
||||
|
||||
G_DEFINE_FINAL_TYPE (GtkTreeListRow, gtk_tree_list_row, G_TYPE_OBJECT)
|
||||
G_DEFINE_TYPE (GtkTreeListRow, gtk_tree_list_row, G_TYPE_OBJECT)
|
||||
|
||||
static void
|
||||
gtk_tree_list_row_destroy (GtkTreeListRow *self)
|
||||
@@ -993,7 +993,7 @@ gtk_tree_list_row_set_property (GObject *object,
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
gtk_tree_list_row_get_property (GObject *object,
|
||||
guint prop_id,
|
||||
GValue *value,
|
||||
|
||||
@@ -60,7 +60,7 @@ enum {
|
||||
|
||||
static GParamSpec *properties[NUM_PROPERTIES] = { NULL, };
|
||||
|
||||
G_DEFINE_FINAL_TYPE (GtkTreeListRowSorter, gtk_tree_list_row_sorter, GTK_TYPE_SORTER)
|
||||
G_DEFINE_TYPE (GtkTreeListRowSorter, gtk_tree_list_row_sorter, GTK_TYPE_SORTER)
|
||||
|
||||
#define MAX_KEY_DEPTH (8)
|
||||
|
||||
@@ -155,7 +155,7 @@ gtk_tree_list_row_sort_keys_compare (gconstpointer a,
|
||||
resa = unpack (keysa, &keysa, &sizea);
|
||||
resb = unpack (keysb, &keysb, &sizeb);
|
||||
if (!resa)
|
||||
return resb ? GTK_ORDERING_LARGER : (keysa[2] < keysb[2] ? GTK_ORDERING_SMALLER :
|
||||
return resb ? GTK_ORDERING_LARGER : (keysa[2] < keysb[2] ? GTK_ORDERING_SMALLER :
|
||||
(keysb[2] > keysa[2] ? GTK_ORDERING_LARGER : GTK_ORDERING_EQUAL));
|
||||
else if (!resb)
|
||||
return GTK_ORDERING_SMALLER;
|
||||
@@ -329,7 +329,7 @@ gtk_tree_list_row_sort_keys_clear_key (GtkSortKeys *keys,
|
||||
|
||||
for (i = 0; i < max && key[i] != NULL; i++)
|
||||
gtk_tree_list_row_sort_keys_unref_key (self, key[i]);
|
||||
|
||||
|
||||
if (key[0] == NULL)
|
||||
g_free (key[1]);
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ enum
|
||||
N_PROPS
|
||||
};
|
||||
|
||||
G_DEFINE_FINAL_TYPE (GtkVideo, gtk_video, GTK_TYPE_WIDGET)
|
||||
G_DEFINE_TYPE (GtkVideo, gtk_video, GTK_TYPE_WIDGET)
|
||||
|
||||
static GParamSpec *properties[N_PROPS] = { NULL, };
|
||||
|
||||
|
||||
@@ -143,9 +143,9 @@ gtk_widget_paintable_paintable_init (GdkPaintableInterface *iface)
|
||||
iface->get_intrinsic_height = gtk_widget_paintable_paintable_get_intrinsic_height;
|
||||
}
|
||||
|
||||
G_DEFINE_FINAL_TYPE_WITH_CODE (GtkWidgetPaintable, gtk_widget_paintable, G_TYPE_OBJECT,
|
||||
G_IMPLEMENT_INTERFACE (GDK_TYPE_PAINTABLE,
|
||||
gtk_widget_paintable_paintable_init))
|
||||
G_DEFINE_TYPE_EXTENDED (GtkWidgetPaintable, gtk_widget_paintable, G_TYPE_OBJECT, 0,
|
||||
G_IMPLEMENT_INTERFACE (GDK_TYPE_PAINTABLE,
|
||||
gtk_widget_paintable_paintable_init))
|
||||
|
||||
static void
|
||||
gtk_widget_paintable_set_property (GObject *object,
|
||||
@@ -289,7 +289,7 @@ gtk_widget_paintable_snapshot_widget (GtkWidgetPaintable *self)
|
||||
|
||||
if (self->widget->priv->render_node == NULL)
|
||||
return gdk_paintable_new_empty (bounds.size.width, bounds.size.height);
|
||||
|
||||
|
||||
return gtk_render_node_paintable_new (self->widget->priv->render_node, &bounds);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
* Modified by the GTK+ Team and others 1997-2000. See the AUTHORS
|
||||
* file for a list of people on the GTK+ Team. See the ChangeLog
|
||||
* files for a list of changes. These files are distributed with
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
* GTK+ at ftp://ftp.gtk.org/pub/gtk/.
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
@@ -148,9 +148,9 @@
|
||||
* # Accessibility
|
||||
*
|
||||
* `GtkWindow` uses the %GTK_ACCESSIBLE_ROLE_WINDOW role.
|
||||
*
|
||||
*
|
||||
* # Actions
|
||||
*
|
||||
*
|
||||
* `GtkWindow` defines a set of built-in actions:
|
||||
* - `default.activate`: Activate the default widget.
|
||||
* - `window.minimize`: Minimize the window.
|
||||
@@ -565,7 +565,7 @@ add_arrow_bindings (GtkWidgetClass *widget_class,
|
||||
GtkDirectionType direction)
|
||||
{
|
||||
guint keypad_keysym = keysym - GDK_KEY_Left + GDK_KEY_KP_Left;
|
||||
|
||||
|
||||
gtk_widget_class_add_binding_signal (widget_class, keysym, 0,
|
||||
"move-focus",
|
||||
"(i)",
|
||||
@@ -593,8 +593,8 @@ extract_time_from_startup_id (const char * startup_id)
|
||||
if (timestr)
|
||||
{
|
||||
char *end;
|
||||
guint32 timestamp;
|
||||
|
||||
guint32 timestamp;
|
||||
|
||||
/* Skip past the "_TIME" part */
|
||||
timestr += 5;
|
||||
|
||||
@@ -845,7 +845,7 @@ gtk_window_class_init (GtkWindowClass *klass)
|
||||
* GtkWindow:destroy-with-parent: (attributes org.gtk.Property.get=gtk_window_get_destroy_with_parent org.gtk.Property.set=gtk_window_set_destroy_with_parent)
|
||||
*
|
||||
* If this window should be destroyed when the parent is destroyed.
|
||||
*/
|
||||
*/
|
||||
window_props[PROP_DESTROY_WITH_PARENT] =
|
||||
g_param_spec_boolean ("destroy-with-parent",
|
||||
P_("Destroy with Parent"),
|
||||
@@ -1233,7 +1233,7 @@ gtk_window_class_init (GtkWindowClass *klass)
|
||||
"activate-focus", NULL);
|
||||
gtk_widget_class_add_binding_signal (widget_class, GDK_KEY_KP_Space, 0,
|
||||
"activate-focus", NULL);
|
||||
|
||||
|
||||
gtk_widget_class_add_binding_signal (widget_class, GDK_KEY_Return, 0,
|
||||
"activate-default", NULL);
|
||||
gtk_widget_class_add_binding_signal (widget_class, GDK_KEY_ISO_Enter, 0,
|
||||
@@ -2401,7 +2401,7 @@ handle_keys_changed (gpointer data)
|
||||
if (priv->application_shortcut_controller)
|
||||
gtk_shortcut_controller_update_accels (GTK_SHORTCUT_CONTROLLER (priv->application_shortcut_controller));
|
||||
g_signal_emit (window, window_signals[KEYS_CHANGED], 0);
|
||||
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -3231,7 +3231,7 @@ get_icon_info (GtkWindow *window)
|
||||
{
|
||||
return g_object_get_qdata (G_OBJECT (window), quark_gtk_window_icon_info);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
free_icon_info (GtkWindowIconInfo *info)
|
||||
{
|
||||
@@ -3246,7 +3246,7 @@ ensure_icon_info (GtkWindow *window)
|
||||
GtkWindowIconInfo *info;
|
||||
|
||||
info = get_icon_info (window);
|
||||
|
||||
|
||||
if (info == NULL)
|
||||
{
|
||||
info = g_slice_new0 (GtkWindowIconInfo);
|
||||
@@ -3422,7 +3422,7 @@ gtk_window_unrealize_icon (GtkWindow *window)
|
||||
|
||||
if (info == NULL)
|
||||
return;
|
||||
|
||||
|
||||
/* We don't clear the properties on the window, just figure the
|
||||
* window is going away.
|
||||
*/
|
||||
@@ -3431,15 +3431,15 @@ gtk_window_unrealize_icon (GtkWindow *window)
|
||||
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
update_themed_icon (GtkWindow *window)
|
||||
{
|
||||
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_ICON_NAME]);
|
||||
|
||||
|
||||
gtk_window_unrealize_icon (window);
|
||||
|
||||
|
||||
if (_gtk_widget_get_realized (GTK_WIDGET (window)))
|
||||
gtk_window_realize_icon (window);
|
||||
gtk_window_realize_icon (window);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -3524,7 +3524,7 @@ gtk_window_set_default_icon_name (const char *name)
|
||||
{
|
||||
GtkWindowIconInfo *info;
|
||||
GtkWindow *w = tmp_list->data;
|
||||
|
||||
|
||||
info = get_icon_info (w);
|
||||
if (info && info->using_default_icon && info->using_themed_icon)
|
||||
{
|
||||
@@ -3617,7 +3617,7 @@ gtk_window_set_default_size_internal (GtkWindow *window,
|
||||
g_object_notify_by_pspec (G_OBJECT (window), window_props[PROP_DEFAULT_HEIGHT]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
g_object_thaw_notify (G_OBJECT (window));
|
||||
}
|
||||
|
||||
@@ -3867,7 +3867,7 @@ gtk_window_show (GtkWidget *widget)
|
||||
|
||||
if (!priv->focus_widget)
|
||||
gtk_window_move_focus (widget, GTK_DIR_TAB_FORWARD);
|
||||
|
||||
|
||||
if (priv->modal)
|
||||
gtk_grab_add (widget);
|
||||
}
|
||||
@@ -3917,7 +3917,7 @@ gtk_window_update_toplevel (GtkWindow *window,
|
||||
GdkToplevelLayout *layout)
|
||||
{
|
||||
GtkWindowPrivate *priv = gtk_window_get_instance_private (window);
|
||||
|
||||
|
||||
if (_gtk_widget_get_mapped (GTK_WIDGET (window)))
|
||||
gdk_toplevel_present (GDK_TOPLEVEL (priv->surface), layout);
|
||||
gdk_toplevel_layout_unref (layout);
|
||||
@@ -4149,7 +4149,7 @@ gtk_window_compute_min_size (GtkWidget *window,
|
||||
while (start < end)
|
||||
{
|
||||
mid = (start + end) / 2;
|
||||
|
||||
|
||||
gtk_widget_measure (window, OPPOSITE_ORIENTATION (orientation), mid, &other, NULL, NULL, NULL);
|
||||
ratio = (double) mid / other;
|
||||
if(ratio == ideal_ratio)
|
||||
@@ -5864,15 +5864,9 @@ _gtk_window_set_is_active (GtkWindow *window,
|
||||
focus = g_object_ref (priv->focus_widget);
|
||||
|
||||
if (is_active)
|
||||
{
|
||||
synthesize_focus_change_events (window, NULL, focus, GTK_CROSSING_ACTIVE);
|
||||
gtk_widget_set_has_focus (focus, TRUE);
|
||||
}
|
||||
synthesize_focus_change_events (window, NULL, focus, GTK_CROSSING_ACTIVE);
|
||||
else
|
||||
{
|
||||
synthesize_focus_change_events (window, focus, NULL, GTK_CROSSING_ACTIVE);
|
||||
gtk_widget_set_has_focus (focus, FALSE);
|
||||
}
|
||||
synthesize_focus_change_events (window, focus, NULL, GTK_CROSSING_ACTIVE);
|
||||
|
||||
g_object_unref (focus);
|
||||
}
|
||||
|
||||
@@ -108,7 +108,7 @@ static GParamSpec *props[LAST_PROP] = { NULL, };
|
||||
|
||||
#define WINDOW_ICON_SIZE 16
|
||||
|
||||
G_DEFINE_FINAL_TYPE (GtkWindowControls, gtk_window_controls, GTK_TYPE_WIDGET)
|
||||
G_DEFINE_TYPE (GtkWindowControls, gtk_window_controls, GTK_TYPE_WIDGET)
|
||||
|
||||
static char *
|
||||
get_layout (GtkWindowControls *self)
|
||||
|
||||
@@ -74,8 +74,8 @@ static GParamSpec *props[LAST_PROP] = { NULL, };
|
||||
|
||||
static void gtk_window_handle_buildable_iface_init (GtkBuildableIface *iface);
|
||||
|
||||
G_DEFINE_FINAL_TYPE_WITH_CODE (GtkWindowHandle, gtk_window_handle, GTK_TYPE_WIDGET,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE, gtk_window_handle_buildable_iface_init))
|
||||
G_DEFINE_TYPE_WITH_CODE (GtkWindowHandle, gtk_window_handle, GTK_TYPE_WIDGET,
|
||||
G_IMPLEMENT_INTERFACE (GTK_TYPE_BUILDABLE, gtk_window_handle_buildable_iface_init))
|
||||
|
||||
static void
|
||||
lower_window (GtkWindowHandle *self)
|
||||
|
||||
|
Before Width: | Height: | Size: 725 B |
|
Before Width: | Height: | Size: 433 B |
|
Before Width: | Height: | Size: 552 B |
|
Before Width: | Height: | Size: 545 B |
|
Before Width: | Height: | Size: 236 B After Width: | Height: | Size: 234 B |
|
Before Width: | Height: | Size: 369 B After Width: | Height: | Size: 351 B |
|
Before Width: | Height: | Size: 282 B After Width: | Height: | Size: 189 B |
|
Before Width: | Height: | Size: 186 B After Width: | Height: | Size: 202 B |
|
Before Width: | Height: | Size: 181 B After Width: | Height: | Size: 187 B |
|
Before Width: | Height: | Size: 226 B After Width: | Height: | Size: 237 B |
|
Before Width: | Height: | Size: 226 B After Width: | Height: | Size: 238 B |
|
Before Width: | Height: | Size: 217 B After Width: | Height: | Size: 169 B |
|
Before Width: | Height: | Size: 295 B After Width: | Height: | Size: 323 B |
|
Before Width: | Height: | Size: 319 B After Width: | Height: | Size: 306 B |
|
Before Width: | Height: | Size: 318 B After Width: | Height: | Size: 316 B |
|
Before Width: | Height: | Size: 195 B After Width: | Height: | Size: 197 B |
|
Before Width: | Height: | Size: 202 B After Width: | Height: | Size: 204 B |
|
Before Width: | Height: | Size: 291 B After Width: | Height: | Size: 334 B |
|
Before Width: | Height: | Size: 209 B After Width: | Height: | Size: 200 B |