[gtk+] gdk/win32: Fix build after GdkScreen and settings changes
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] gdk/win32: Fix build after GdkScreen and settings changes
- Date: Tue, 31 Oct 2017 06:50:37 +0000 (UTC)
commit b0dc8514e440a75753e91119cd90646fc08f8059
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Tue Oct 31 12:49:44 2017 +0800
gdk/win32: Fix build after GdkScreen and settings changes
Implement GdkDisplay->get_setting() using the existing
_gdk_win32_screen_get_setting() and get rid of GdkScreen->get_setting()
as a result, to follow the changes in GDK.
Also, since we don't emit settings events in the Windows GDK backend,
but we acquire settings to print using GDK_SETTING, drop all references
related to GDK_SETTING since that is now removed. Update the debug
strings that are print out as a result
(gdk_screen_get_setting->gdk_display_get_setting).
https://bugzilla.gnome.org/show_bug.cgi?id=773299
gdk/win32/gdkdisplay-win32.c | 12 ++++++++++++
gdk/win32/gdkevents-win32.c | 8 --------
gdk/win32/gdkproperty-win32.c | 18 +++++++++---------
gdk/win32/gdkscreen-win32.c | 1 -
4 files changed, 21 insertions(+), 18 deletions(-)
---
diff --git a/gdk/win32/gdkdisplay-win32.c b/gdk/win32/gdkdisplay-win32.c
index 10ae262..71ffe71 100644
--- a/gdk/win32/gdkdisplay-win32.c
+++ b/gdk/win32/gdkdisplay-win32.c
@@ -1228,6 +1228,16 @@ _gdk_win32_display_get_monitor_scale_factor (GdkWin32Display *win32_display,
}
}
+static gboolean
+gdk_win32_display_get_setting (GdkDisplay *display,
+ const gchar *name,
+ GValue *value)
+{
+ return _gdk_win32_screen_get_setting (GDK_WIN32_DISPLAY (display)->screen,
+ name,
+ value);
+}
+
static void
gdk_win32_display_class_init (GdkWin32DisplayClass *klass)
{
@@ -1289,5 +1299,7 @@ gdk_win32_display_class_init (GdkWin32DisplayClass *klass)
display_class->vk_extension_name = VK_KHR_WIN32_SURFACE_EXTENSION_NAME;
#endif
+ display_class->get_setting = gdk_win32_display_get_setting;
+
_gdk_win32_windowing_init ();
}
diff --git a/gdk/win32/gdkevents-win32.c b/gdk/win32/gdkevents-win32.c
index 0602bba..f41cbc3 100644
--- a/gdk/win32/gdkevents-win32.c
+++ b/gdk/win32/gdkevents-win32.c
@@ -676,7 +676,6 @@ _gdk_win32_print_event (const GdkEvent *event)
CASE (GDK_VISIBILITY_NOTIFY);
CASE (GDK_SCROLL);
CASE (GDK_WINDOW_STATE);
- CASE (GDK_SETTING);
CASE (GDK_OWNER_CHANGE);
CASE (GDK_GRAB_BROKEN);
#undef CASE
@@ -796,13 +795,6 @@ _gdk_win32_print_event (const GdkEvent *event)
g_print ("%s: %s",
_gdk_win32_window_state_to_string (event->window_state.changed_mask),
_gdk_win32_window_state_to_string (event->window_state.new_window_state));
- case GDK_SETTING:
- g_print ("%s: %s",
- (event->setting.action == GDK_SETTING_ACTION_NEW ? "NEW" :
- (event->setting.action == GDK_SETTING_ACTION_CHANGED ? "CHANGED" :
- (event->setting.action == GDK_SETTING_ACTION_DELETED ? "DELETED" :
- "???"))),
- (event->setting.name ? event->setting.name : "NULL"));
case GDK_GRAB_BROKEN:
g_print ("%s %s %p",
(event->grab_broken.keyboard ? "KEYBOARD" : "POINTER"),
diff --git a/gdk/win32/gdkproperty-win32.c b/gdk/win32/gdkproperty-win32.c
index 65850c3..0c70a92 100644
--- a/gdk/win32/gdkproperty-win32.c
+++ b/gdk/win32/gdkproperty-win32.c
@@ -361,45 +361,45 @@ _gdk_win32_screen_get_setting (GdkScreen *screen,
if (strcmp ("gtk-double-click-time", name) == 0)
{
gint i = GetDoubleClickTime ();
- GDK_NOTE(MISC, g_print("gdk_screen_get_setting(\"%s\") : %d\n", name, i));
+ GDK_NOTE(MISC, g_print("gdk_display_get_setting(\"%s\") : %d\n", name, i));
g_value_set_int (value, i);
return TRUE;
}
else if (strcmp ("gtk-double-click-distance", name) == 0)
{
gint i = MAX(GetSystemMetrics (SM_CXDOUBLECLK), GetSystemMetrics (SM_CYDOUBLECLK));
- GDK_NOTE(MISC, g_print("gdk_screen_get_setting(\"%s\") : %d\n", name, i));
+ GDK_NOTE(MISC, g_print("gdk_display_get_setting(\"%s\") : %d\n", name, i));
g_value_set_int (value, i);
return TRUE;
}
else if (strcmp ("gtk-dnd-drag-threshold", name) == 0)
{
gint i = MAX(GetSystemMetrics (SM_CXDRAG), GetSystemMetrics (SM_CYDRAG));
- GDK_NOTE(MISC, g_print("gdk_screen_get_setting(\"%s\") : %d\n", name, i));
+ GDK_NOTE(MISC, g_print("gdk_display_get_setting(\"%s\") : %d\n", name, i));
g_value_set_int (value, i);
return TRUE;
}
else if (strcmp ("gtk-split-cursor", name) == 0)
{
- GDK_NOTE(MISC, g_print("gdk_screen_get_setting(\"%s\") : FALSE\n", name));
+ GDK_NOTE(MISC, g_print("gdk_display_get_setting(\"%s\") : FALSE\n", name));
g_value_set_boolean (value, FALSE);
return TRUE;
}
else if (strcmp ("gtk-alternative-button-order", name) == 0)
{
- GDK_NOTE(MISC, g_print("gdk_screen_get_setting(\"%s\") : TRUE\n", name));
+ GDK_NOTE(MISC, g_print("gdk_display_get_setting(\"%s\") : TRUE\n", name));
g_value_set_boolean (value, TRUE);
return TRUE;
}
else if (strcmp ("gtk-alternative-sort-arrows", name) == 0)
{
- GDK_NOTE(MISC, g_print("gdk_screen_get_setting(\"%s\") : TRUE\n", name));
+ GDK_NOTE(MISC, g_print("gdk_display_get_setting(\"%s\") : TRUE\n", name));
g_value_set_boolean (value, TRUE);
return TRUE;
}
else if (strcmp ("gtk-shell-shows-desktop", name) == 0)
{
- GDK_NOTE(MISC, g_print("gdk_screen_get_setting(\"%s\") : TRUE\n", name));
+ GDK_NOTE(MISC, g_print("gdk_display_get_setting(\"%s\") : TRUE\n", name));
g_value_set_boolean (value, TRUE);
return TRUE;
}
@@ -444,14 +444,14 @@ _gdk_win32_screen_get_setting (GdkScreen *screen,
*/
int nHeight = (0 > ncm.lfMenuFont.lfHeight ? - 3 * ncm.lfMenuFont.lfHeight / 4 : 10);
if (OUT_STRING_PRECIS == ncm.lfMenuFont.lfOutPrecision)
- GDK_NOTE(MISC, g_print("gdk_screen_get_setting(%s) : ignoring bitmap font '%s'\n",
+ GDK_NOTE(MISC, g_print("gdk_display_get_setting(%s) : ignoring bitmap font '%s'\n",
name, ncm.lfMenuFont.lfFaceName));
else if (ncm.lfMenuFont.lfFaceName && strlen(ncm.lfMenuFont.lfFaceName) > 0 &&
/* Avoid issues like those described in bug #135098 */
g_utf8_validate (ncm.lfMenuFont.lfFaceName, -1, NULL))
{
char *s = g_strdup_printf ("%s %d", ncm.lfMenuFont.lfFaceName, nHeight);
- GDK_NOTE(MISC, g_print("gdk_screen_get_setting(%s) : %s\n", name, s));
+ GDK_NOTE(MISC, g_print("gdk_display_get_setting(%s) : %s\n", name, s));
g_value_set_string (value, s);
g_free(s);
diff --git a/gdk/win32/gdkscreen-win32.c b/gdk/win32/gdkscreen-win32.c
index 1b5c885..addfe01 100644
--- a/gdk/win32/gdkscreen-win32.c
+++ b/gdk/win32/gdkscreen-win32.c
@@ -205,5 +205,4 @@ gdk_win32_screen_class_init (GdkWin32ScreenClass *klass)
screen_class->get_display = gdk_win32_screen_get_display;
screen_class->get_root_window = gdk_win32_screen_get_root_window;
- screen_class->get_setting = _gdk_win32_screen_get_setting;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]