aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJan Djärv2012-12-03 20:16:17 +0100
committerJan Djärv2012-12-03 20:16:17 +0100
commit005c8d1340722a2a34b447a2ade4e4bf5bd077d0 (patch)
tree26d41ebf20fe3076d4dc10d271b8c9d7c17d00ca /src
parent475eea6f70ccf3cba346b5c66f924d612d5484aa (diff)
downloademacs-005c8d1340722a2a34b447a2ade4e4bf5bd077d0.tar.gz
emacs-005c8d1340722a2a34b447a2ade4e4bf5bd077d0.zip
* gtkutil.c (my_log_handler): New function.
(xg_set_geometry): Set log handler to my_log_handler. Fixes: debbugs:11177
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog5
-rw-r--r--src/gtkutil.c15
2 files changed, 20 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 5bcd89e4ca1..f2b65db257d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
12012-12-03 Jan Djärv <jan.h.d@swipnet.se>
2
3 * gtkutil.c (my_log_handler): New function.
4 (xg_set_geometry): Set log handler to my_log_handler (Bug#11177).
5
12012-12-03 Dmitry Antipov <dmantipov@yandex.ru> 62012-12-03 Dmitry Antipov <dmantipov@yandex.ru>
2 7
3 * lisp.h (modify_region): Rename to... 8 * lisp.h (modify_region): Rename to...
diff --git a/src/gtkutil.c b/src/gtkutil.c
index 4367b534cb9..52a6c37b0d5 100644
--- a/src/gtkutil.c
+++ b/src/gtkutil.c
@@ -813,6 +813,14 @@ xg_hide_tooltip (FRAME_PTR f)
813 General functions for creating widgets, resizing, events, e.t.c. 813 General functions for creating widgets, resizing, events, e.t.c.
814 ***********************************************************************/ 814 ***********************************************************************/
815 815
816static void
817my_log_handler (const gchar *log_domain, GLogLevelFlags log_level,
818 const gchar *msg, gpointer user_data)
819{
820 if (!strstr (msg, "visible children"))
821 fprintf (stderr, "XX %s-WARNING **: %s\n", log_domain, msg);
822}
823
816/* Make a geometry string and pass that to GTK. It seems this is the 824/* Make a geometry string and pass that to GTK. It seems this is the
817 only way to get geometry position right if the user explicitly 825 only way to get geometry position right if the user explicitly
818 asked for a position when starting Emacs. 826 asked for a position when starting Emacs.
@@ -828,6 +836,7 @@ xg_set_geometry (FRAME_PTR f)
828 int top = f->top_pos; 836 int top = f->top_pos;
829 int yneg = f->size_hint_flags & YNegative; 837 int yneg = f->size_hint_flags & YNegative;
830 char geom_str[sizeof "=x--" + 4 * INT_STRLEN_BOUND (int)]; 838 char geom_str[sizeof "=x--" + 4 * INT_STRLEN_BOUND (int)];
839 guint id;
831 840
832 if (xneg) 841 if (xneg)
833 left = -left; 842 left = -left;
@@ -840,9 +849,15 @@ xg_set_geometry (FRAME_PTR f)
840 (xneg ? '-' : '+'), left, 849 (xneg ? '-' : '+'), left,
841 (yneg ? '-' : '+'), top); 850 (yneg ? '-' : '+'), top);
842 851
852 /* Silence warning about visible children. */
853 id = g_log_set_handler ("Gtk", G_LOG_LEVEL_WARNING | G_LOG_FLAG_FATAL
854 | G_LOG_FLAG_RECURSION, my_log_handler, NULL);
855
843 if (!gtk_window_parse_geometry (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)), 856 if (!gtk_window_parse_geometry (GTK_WINDOW (FRAME_GTK_OUTER_WIDGET (f)),
844 geom_str)) 857 geom_str))
845 fprintf (stderr, "Failed to parse: '%s'\n", geom_str); 858 fprintf (stderr, "Failed to parse: '%s'\n", geom_str);
859
860 g_log_remove_handler ("Gtk", id);
846 } 861 }
847} 862}
848 863