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
This commit is contained in:
Chun-wei Fan 2017-10-31 12:49:44 +08:00
parent 941a621ea9
commit b0dc8514e4
4 changed files with 21 additions and 18 deletions

View File

@ -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 ();
}

View File

@ -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"),

View File

@ -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);

View File

@ -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;
}