unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#16522: 24.3.50; Regression: GLib-GObject warnings on stderr
@ 2014-01-22 15:50 Barry OReilly
  2014-01-24 19:16 ` Paul Eggert
  2014-02-11 22:43 ` Barry OReilly
  0 siblings, 2 replies; 7+ messages in thread
From: Barry OReilly @ 2014-01-22 15:50 UTC (permalink / raw)
  To: 16522

[-- Attachment #1: Type: text/plain, Size: 2527 bytes --]

When I start emacs, I get errors like:

(emacs:13939): GLib-GObject-WARNING **: IA__g_object_notify: object class
`GtkMenuItem' has no property named `label'

They appear periodically as I do various things in Emacs. The first
one appears before doing anything at all. I do not witness these
warnings using Emacs 24.3.

This is with recent trunk revision a693e5b566a7a88fecbb95b1f64426c9f52b3198.

In GNU Emacs 24.3.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 2.10.4)
 of 2014-01-21 on redacted
Repository revision:
Windowing system distributor `The X.Org Foundation', version 11.0.70101000
System Description:    Red Hat Enterprise Linux Client release 5.4 (Tikanga)

Configured using:
 `configure --prefix
 /redacted/user/boreilly/sw/emacs-install-redacted
 --with-gif=no'

Important settings:
  value of $LANG: en_US
  value of $XMODIFIERS: @im=none
  locale-coding-system: iso-latin-1-unix

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
M-x r e p o r t - <tab> <return>

Recent messages:
For information about GNU Emacs and the GNU system, type C-h C-a.

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr emacsbug message format-spec rfc822 mml
easymenu mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231
mailabbrev gmm-utils mailheader sendmail rfc2047 rfc2045 ietf-drums
mm-util help-fns mail-prsvr mail-utils time-date tooltip electric
uniquify ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar
dnd fontset image regexp-opt fringe tabulated-list newcomment lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
dbusbind dynamic-setting system-font-setting font-render-setting
move-toolbar gtk x-toolkit x multi-tty emacs)

[-- Attachment #2: Type: text/html, Size: 2837 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#16522: 24.3.50; Regression: GLib-GObject warnings on stderr
  2014-01-22 15:50 bug#16522: 24.3.50; Regression: GLib-GObject warnings on stderr Barry OReilly
@ 2014-01-24 19:16 ` Paul Eggert
  2014-10-11 18:16   ` Glenn Morris
  2014-02-11 22:43 ` Barry OReilly
  1 sibling, 1 reply; 7+ messages in thread
From: Paul Eggert @ 2014-01-24 19:16 UTC (permalink / raw)
  To: 16522

[-- Attachment #1: Type: text/plain, Size: 471 bytes --]

GtkMenuItem's "label" property was introduced in GTK+ 2.16, according to 
<https://bugreports.qt-project.org/browse/QTBUG-8537>. You're using GTK+ 
2.10.4, which could explain the problem. I'm using Firefox 20 which has 
GTK+ 3.10.6 and do not see the problem.

I suspect that the attached patch (which is trunk bzr 115967.1.1) is 
what introduced the problem. If you back this change out, does it fix 
things? I'll CC: this to Daniel Colascione to give him a heads-up.


[-- Attachment #2: 115967.1.1.diff --]
[-- Type: text/x-patch, Size: 4976 bytes --]

=== modified file 'src/ChangeLog'
--- src/ChangeLog	2014-01-07 21:14:32 +0000
+++ src/ChangeLog	2014-01-13 01:40:35 +0000
@@ -1,3 +1,16 @@
+2014-01-13  Daniel Colascione  <dancol@dancol.org>
+
+	Fix menu item updating in the presence of the Unity global menu
+	GTK+ module.
+
+	* gtkutil.h (xg_have_tear_offs): Add frame parameter
+	* gtkutil.c (xg_have_tear_offs): Count the global menu as a
+	tear-off.
+	(xg_update_menubar,xg_update_menu_item): Call g_object_notify when
+	updating menus; explain why.
+	* xmenu.c (set_frame_menubar): Call xg_have_tear_offs with new
+	parameter.
+
 2014-01-07  Paul Eggert  <eggert@cs.ucla.edu>
 
 	Fix misdisplay of interlaced GIFs with libgif5 (Bug#16372).

=== modified file 'src/gtkutil.c'
--- src/gtkutil.c	2014-01-01 07:43:34 +0000
+++ src/gtkutil.c	2014-01-13 01:40:35 +0000
@@ -2414,9 +2414,12 @@
 /* Return true if there are detached menus.  */
 
 bool
-xg_have_tear_offs (void)
+xg_have_tear_offs (struct frame *f)
 {
-  return xg_detached_menus > 0;
+  /* If the frame's menubar height is zero, the menu bar is probably
+     being redirected outside the window to some kind of global menu;
+     this situation is the moral equivalent of a tear-off.  */
+  return FRAME_MENUBAR_HEIGHT (f) == 0 || xg_detached_menus > 0;
 }
 
 /* Callback invoked when a detached menu window is removed.  Here we
@@ -2449,9 +2452,9 @@
 }
 #else /* ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW */
 bool
-xg_have_tear_offs (void)
+xg_have_tear_offs (struct frame *f)
 {
-  return false;
+  return FRAME_MENUBAR_HEIGHT (f) == 0;
 }
 #endif /* ! HAVE_GTK_TEAROFF_MENU_ITEM_NEW */
 
@@ -2897,7 +2900,13 @@
           char *utf8_label = get_utf8_string (val->name);
           GtkWidget *submenu = gtk_menu_item_get_submenu (witem);
 
+          /* GTK menu items don't notice when their labels have been
+             changed from underneath them, so we have to explicitly
+             use g_object_notify to tell listeners (e.g., a GMenuModel
+             bridge that might be loaded) that the item's label has
+             changed.  */
           gtk_label_set_text (wlabel, utf8_label);
+          g_object_notify (G_OBJECT (witem), "label");
 
 #ifdef HAVE_GTK_TEAROFF_MENU_ITEM_NEW
           /* If this item has a submenu that has been detached, change
@@ -2934,6 +2943,7 @@
                                              select_cb, deactivate_cb,
                                              highlight_cb,
                                              0, 0, 0, 0, cl_data, 0);
+
           gtk_widget_set_name (w, MENU_ITEM_NAME);
           gtk_menu_shell_insert (GTK_MENU_SHELL (menubar), w, pos);
           gtk_menu_item_set_submenu (GTK_MENU_ITEM (w), submenu);
@@ -2993,6 +3003,7 @@
   const char *old_label = 0;
   const char *old_key = 0;
   xg_menu_item_cb_data *cb_data;
+  bool label_changed = false;
 
   wchild = XG_BIN_CHILD (w);
   utf8_label = get_utf8_string (val->name);
@@ -3037,15 +3048,20 @@
         }
     }
 
-
   if (wkey) old_key = gtk_label_get_label (wkey);
   if (wlbl) old_label = gtk_label_get_label (wlbl);
 
   if (wkey && utf8_key && (! old_key || strcmp (utf8_key, old_key) != 0))
-    gtk_label_set_text (wkey, utf8_key);
+    {
+      label_changed = true;
+      gtk_label_set_text (wkey, utf8_key);
+    }
 
   if (! old_label || strcmp (utf8_label, old_label) != 0)
-    gtk_label_set_text (wlbl, utf8_label);
+    {
+      label_changed = true;
+      gtk_label_set_text (wlbl, utf8_label);
+    }
 
   if (utf8_key) g_free (utf8_key);
   if (utf8_label) g_free (utf8_label);
@@ -3077,6 +3093,9 @@
           cb_data->select_id = 0;
         }
     }
+
+  if (label_changed) /* See comment in xg_update_menubar.  */
+    g_object_notify (G_OBJECT (w), "label");
 }
 
 /* Update the toggle menu item W so it corresponds to VAL.  */
@@ -3359,11 +3378,6 @@
   gtk_widget_show_all (x->menubar_widget);
   gtk_widget_get_preferred_size (x->menubar_widget, NULL, &req);
 
-  /* If menu bar doesn't know its height yet, cheat a little so the frame
-     doesn't jump so much when resized later in menubar_map_cb.  */
-  if (req.height == 0)
-    req.height = 23;
-
   if (FRAME_MENUBAR_HEIGHT (f) != req.height)
     {
       FRAME_MENUBAR_HEIGHT (f) = req.height;

=== modified file 'src/gtkutil.h'
--- src/gtkutil.h	2014-01-01 07:43:34 +0000
+++ src/gtkutil.h	2014-01-13 01:40:35 +0000
@@ -107,7 +107,7 @@
 
 extern bool xg_event_is_for_menubar (struct frame *, const XEvent *);
 
-extern bool xg_have_tear_offs (void);
+extern bool xg_have_tear_offs (struct frame *f);
 
 extern ptrdiff_t xg_get_scroll_id_for_window (Display *dpy, Window wid);
 

=== modified file 'src/xmenu.c'
--- src/xmenu.c	2014-01-01 07:43:34 +0000
+++ src/xmenu.c	2014-01-13 01:40:35 +0000
@@ -796,7 +796,7 @@
 #ifdef USE_GTK
   /* If we have detached menus, we must update deep so detached menus
      also gets updated.  */
-  deep_p = deep_p || xg_have_tear_offs ();
+  deep_p = deep_p || xg_have_tear_offs (f);
 #endif
 
   if (deep_p)


^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#16522: 24.3.50; Regression: GLib-GObject warnings on stderr
  2014-01-22 15:50 bug#16522: 24.3.50; Regression: GLib-GObject warnings on stderr Barry OReilly
  2014-01-24 19:16 ` Paul Eggert
@ 2014-02-11 22:43 ` Barry OReilly
  1 sibling, 0 replies; 7+ messages in thread
From: Barry OReilly @ 2014-02-11 22:43 UTC (permalink / raw)
  To: 16522

[-- Attachment #1: Type: text/plain, Size: 302 bytes --]

> I suspect that the attached patch (which is trunk bzr 115967.1.1) is
> what introduced the problem. If you back this change out, does it
> fix things? I'll CC: this to Daniel Colascione to give him a
> heads-up.

Confirmed: reversing the patch on today's trunk causes the error message to
disappear.

[-- Attachment #2: Type: text/html, Size: 367 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#16522: 24.3.50; Regression: GLib-GObject warnings on stderr
  2014-01-24 19:16 ` Paul Eggert
@ 2014-10-11 18:16   ` Glenn Morris
  2014-10-19 17:28     ` Jan Djärv
  0 siblings, 1 reply; 7+ messages in thread
From: Glenn Morris @ 2014-10-11 18:16 UTC (permalink / raw)
  To: 16522, Daniel Colascione; +Cc: Paul Eggert

Paul Eggert wrote:

> GtkMenuItem's "label" property was introduced in GTK+ 2.16, according
> to <https://bugreports.qt-project.org/browse/QTBUG-8537>. You're using
> GTK+ 2.10.4, which could explain the problem. I'm using Firefox 20
> which has GTK+ 3.10.6 and do not see the problem.
>
> I suspect that the attached patch (which is trunk bzr 115967.1.1) is
> what introduced the problem. If you back this change out, does it fix
> things? I'll CC: this to Daniel Colascione to give him a heads-up.

Any comment on this issue?





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#16522: 24.3.50; Regression: GLib-GObject warnings on stderr
  2014-10-11 18:16   ` Glenn Morris
@ 2014-10-19 17:28     ` Jan Djärv
  2014-10-19 17:35       ` Glenn Morris
  0 siblings, 1 reply; 7+ messages in thread
From: Jan Djärv @ 2014-10-19 17:28 UTC (permalink / raw)
  To: Glenn Morris, 16522-done, Daniel Colascione; +Cc: Paul Eggert

Hi.

Den 2014-10-11 20:16, Glenn Morris skrev:
> Paul Eggert wrote:
>
>> GtkMenuItem's "label" property was introduced in GTK+ 2.16, according
>> to <https://bugreports.qt-project.org/browse/QTBUG-8537>. You're using
>> GTK+ 2.10.4, which could explain the problem. I'm using Firefox 20
>> which has GTK+ 3.10.6 and do not see the problem.
>>
>> I suspect that the attached patch (which is trunk bzr 115967.1.1) is
>> what introduced the problem. If you back this change out, does it fix
>> things? I'll CC: this to Daniel Colascione to give him a heads-up.
>
> Any comment on this issue?
>

I added the obvious gtk version check.

	Jan D.







^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#16522: 24.3.50; Regression: GLib-GObject warnings on stderr
  2014-10-19 17:28     ` Jan Djärv
@ 2014-10-19 17:35       ` Glenn Morris
  2014-10-19 17:53         ` Jan Djärv
  0 siblings, 1 reply; 7+ messages in thread
From: Glenn Morris @ 2014-10-19 17:35 UTC (permalink / raw)
  To: Jan Djärv; +Cc: 16522

Jan Djärv wrote:

> I added the obvious gtk version check.

Thanks.
Note this issue is in emacs-24 branch too. Does it matter, or is it just
a warning?





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#16522: 24.3.50; Regression: GLib-GObject warnings on stderr
  2014-10-19 17:35       ` Glenn Morris
@ 2014-10-19 17:53         ` Jan Djärv
  0 siblings, 0 replies; 7+ messages in thread
From: Jan Djärv @ 2014-10-19 17:53 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 16522

Den 2014-10-19 19:35, Glenn Morris skrev:
> Jan Djärv wrote:
>
>> I added the obvious gtk version check.
>
> Thanks.
> Note this issue is in emacs-24 branch too. Does it matter, or is it just
> a warning?
>

It is just a warning.  g_object_notify returns without doing anything or any harm.

	Jan D.






^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2014-10-19 17:53 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-22 15:50 bug#16522: 24.3.50; Regression: GLib-GObject warnings on stderr Barry OReilly
2014-01-24 19:16 ` Paul Eggert
2014-10-11 18:16   ` Glenn Morris
2014-10-19 17:28     ` Jan Djärv
2014-10-19 17:35       ` Glenn Morris
2014-10-19 17:53         ` Jan Djärv
2014-02-11 22:43 ` Barry OReilly

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).