[gtk: 1/3] Fix various new mingw compiler warnings
- From: Christoph Reiter <creiter src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk: 1/3] Fix various new mingw compiler warnings
- Date: Thu, 19 Dec 2019 18:00:39 +0000 (UTC)
commit 8f8229dcd28329e7d23ccff0093b6243bc84bb0c
Author: Christoph Reiter <reiter christoph gmail com>
Date: Tue Dec 17 20:46:36 2019 +0100
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.
gtk/gtkimcontextime.c | 4 ++--
tests/simple.c | 29 ++++++++++++++++-------------
2 files changed, 18 insertions(+), 15 deletions(-)
---
diff --git a/gtk/gtkimcontextime.c b/gtk/gtkimcontextime.c
index 8b08d7179d..ec009d40bb 100644
--- a/gtk/gtkimcontextime.c
+++ b/gtk/gtkimcontextime.c
@@ -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);
}
diff --git a/tests/simple.c b/tests/simple.c
index 7cd8d52d68..c6a7bf9b7f 100644
--- a/tests/simple.c
+++ b/tests/simple.c
@@ -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");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]