Fix various new mingw compiler warnings

These are the result of us missing CI for some time now and
MSYS2 having a newer GCC now I guess.
This commit is contained in:
Christoph Reiter 2019-12-17 20:46:36 +01:00
parent 0f2281e267
commit 8f8229dcd2
2 changed files with 18 additions and 15 deletions

View File

@ -682,7 +682,7 @@ gtk_im_context_ime_focus_in (GtkIMContext *context)
toplevel = context_ime->client_surface;
if (GDK_IS_SURFACE (toplevel))
{
gdk_win32_display_add_filter (gdk_surface_get_display (toplevel),
gdk_win32_display_add_filter (GDK_WIN32_DISPLAY (gdk_surface_get_display (toplevel)),
gtk_im_context_ime_message_filter, context_ime);
}
else
@ -780,7 +780,7 @@ gtk_im_context_ime_focus_out (GtkIMContext *context)
toplevel = context_ime->client_surface;
if (GDK_IS_SURFACE (toplevel))
{
gdk_win32_display_remove_filter (gdk_surface_get_display (toplevel),
gdk_win32_display_remove_filter (GDK_WIN32_DISPLAY (gdk_surface_get_display (toplevel)),
gtk_im_context_ime_message_filter,
context_ime);
}

View File

@ -82,9 +82,8 @@ hello (void)
int
main (int argc, char *argv[])
{
GtkWidget *window, *box;
GtkWidget *window;
GtkWidget *button = NULL;
GdkClipboard *clipboard;
gtk_init ();
@ -103,21 +102,25 @@ main (int argc, char *argv[])
button = gtk_button_new ();
#ifdef G_OS_UNIX /* portal usage is supported on *nix only */
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_button_set_label (GTK_BUTTON (button), "copy");
g_signal_connect (button, "clicked", G_CALLBACK (copy), NULL);
gtk_container_add (GTK_CONTAINER (box), button);
{
GtkWidget *box;
GdkClipboard *clipboard;
button = gtk_button_new ();
gtk_button_set_label (GTK_BUTTON (button), "paste");
g_signal_connect (button, "clicked", G_CALLBACK (paste), NULL);
gtk_container_add (GTK_CONTAINER (box), button);
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
gtk_button_set_label (GTK_BUTTON (button), "copy");
g_signal_connect (button, "clicked", G_CALLBACK (copy), NULL);
gtk_container_add (GTK_CONTAINER (box), button);
gtk_container_add (GTK_CONTAINER (window), box);
button = gtk_button_new ();
gtk_button_set_label (GTK_BUTTON (button), "paste");
g_signal_connect (button, "clicked", G_CALLBACK (paste), NULL);
gtk_container_add (GTK_CONTAINER (box), button);
clipboard = gdk_display_get_clipboard (gdk_display_get_default ());
g_signal_connect (clipboard, "changed", G_CALLBACK (clipboard_changed), NULL);
gtk_container_add (GTK_CONTAINER (window), box);
clipboard = gdk_display_get_clipboard (gdk_display_get_default ());
g_signal_connect (clipboard, "changed", G_CALLBACK (clipboard_changed), NULL);
}
#else /* G_OS_UNIX -- original non-portal-enabled code */
gtk_button_set_label (GTK_BUTTON (button), "hello world");