masm11 / emacs

Mirror of GNU Emacs
http://www.gnu.org/software/emacs/
GNU General Public License v3.0
198 stars 14 forks source link

menu-bar-mode freezes emacs #45

Closed A6GibKm closed 3 years ago

A6GibKm commented 4 years ago

In emacs -Q using the function M-x menu-bar-mode freezes Emacs. Resizing or moving the the frame hides the menu as intenteded and unfreezes Emacs.

To reproduce this bug the emacs window has to be maximized by pressing doble left-click on the title bar of the app (where it says emacs@host), this happens in GNOME 3.36. This does not happen when the window is in its default size.

A similar, probably related, freeze happens when running M-x toggle-frame-maximized. To unfreeze and resize the frame, move the cursor to the activities hot corner, or press the windows key.

fejfighter commented 4 years ago

@A6GibKm, confirmed with a fresh build, I'll have a look into it now

I think it;s in the window size calculation code by what you are saying

fejfighter commented 4 years ago

Something may have changed upstream to get this currently bisecting ~150 commits

The older upstream base for my native comp branch did not have the issue

fejfighter commented 4 years ago

Ok, early upstream theory is gone, it;s a redisplay issue

emacs hasn't strictly frozen, but it does not update the display

masm11 commented 4 years ago

reproduced. i'm debugging.

gtk_widget_queue_draw() is called, but pgtk_handle_draw() isn't called.

what's going on...

fejfighter commented 4 years ago

I wonder if the wrong widget is getting and trapping the signal.

that would be one of the only things that might make sense.

I couldn't figure out how to get relevant signal information from the gtk debugger

masm11 commented 4 years ago

it must be affected by this issue: https://gitlab.gnome.org/GNOME/gtk/-/issues/2907

please wait until the gtk issue is fixed.

Thaodan commented 3 years ago

Is this also triggered by using dbus menubars with messages like this in stderr: "Attempting to add a widget with type GtkBox to a GtkMenuItem, but as a GtkBin subclass a GtkMenuItem can only contain one widget at a time; it already contains a widget of type GtkAccelLabel"

Thaodan commented 3 years ago

Also the issue is about wayland, does it also affect X11?

masm11 commented 3 years ago

@Thaodan what is "dbus menubar"?

Thaodan commented 3 years ago

A system where you export the menubar via dbus to be used by other plugins like gnome shell or plasma. The thing is that the emacs menubar didn't behaved like usual gtk apps. This could get better by a clean gtk port.

The errors are something like this:


(emacs-28-0-50:35195): Gtk-WARNING **: 23:48:31.818: Attempting to add a widget with type GtkLabel to a GtkMenuItem, but as a GtkBin subclass a GtkMenuItem can only contain one widget at a time; it already contains a widget of type GtkAccelLabel

(emacs-28-0-50:35195): Gtk-CRITICAL **: 23:48:31.818: gtk_label_get_label: assertion 'GTK_IS_LABEL (label)' failed

(emacs-28-0-50:35195): Gtk-CRITICAL **: 23:48:31.818: gtk_label_set_text: assertion 'GTK_IS_LABEL (label)' failed

(emacs-28-0-50:35195): Gtk-WARNING **: 23:48:33.356: Attempting to add a widget with type GtkBox to a GtkMenuItem, but as a GtkBin subclass a GtkMenuItem can only contain one widget at a time; it already contains a widget of type GtkAccelLabel
masm11 commented 3 years ago

@Thaodan This issue does not emit such messages. Could you create another issue?

A6GibKm commented 3 years ago

This is fixed on GNOME 3.38, at least on the version bundled with Fedora 33. Thanks for the clarification @masm11.

masm11 commented 3 years ago

Thanks, but this is not fixed yet in my environment. Reopen for a while.

A6GibKm commented 3 years ago

https://gitlab.gnome.org/GNOME/gtk/-/merge_requests/2542 Was recently closed :tada:. The fix missed the latest gtk release 3.24.23 by a few days. I don't know why I have this patch applied in fedora 33.

masm11 commented 3 years ago

gtk+3.24.24 is released. I confirmed this issue is fixed with it. I'll close.