0

With Emacs GTK, when left clicking with the mouse on an empty part of the menubar, it starts moving the whole window (aka it moves the frame).
Emacs is doing this also, when starting it with emacs -Q.
I would like to rebind this action to another function, but since emacs seems to not register this click. And my Windowmanager is not handling this click, the question is:

Where to search for the function, which tells my windowmanager to move this window?

Emacs-lucid was not doing this, but emacs-gtk does it.
Is this a GTK feature?
But if so: why are other GTK programs, which share the same ~/.gtkrc-2.0 config file, not showing this behavior?
Is there another gtk config file which emacs is using? Because removing the file ~/.gtkrc-2.0 does not change emacs behavior.

More detail on emacs' behavior

A short click into the red marked area (see picture below) makes the frame stick to the mouse pointer until you click again. And a mouse click drag action, moves the window.

Other GTK programs do not show this behavior. (Edit: This is not the case, I was just checking against GTK2 programs)

As comments show this is not always standard behavior of emacs.

Edit: This question is not just emacs, but related to all GTK3 programs.

marking the area where to click

  • I don't get that behaviour. Clicks or drags on the menu bar don't do anything. Are you sure you are clicking on the menubar and not on the window titlebar? Version info: GNU Emacs 26.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.20.10) of 2017-04-14 – NickD Jun 4 '17 at 18:52
  • This is likely platform-dependent. On MS Windows such a click is not seen by Emacs. But if it is seen by your Emacs, use C-h k to find out what Emacs thinks the key (likely a "special event") is. Then bind that event in special-event-map to the command you want. – Drew Jun 4 '17 at 19:44
  • @Nick: I am using GNU Emacs 24.5.1 (i586-pc-linux-gnu, GTK+ Version 3.14.5) and are not clicking on the visual fluff of the Windowmanager, – jue Jun 5 '17 at 7:00
  • @Drew C-h k does not register the click, so this means its a GTK thing? If so this is not emacs related, but where to search for this click? – jue Jun 5 '17 at 7:04
  • It's not clear where you are clicking, so it's not clear whether Emacs should recognize the click. But if Emacs does not recognize it then it is likely (lacking other info) that this is a platform thing, not an Emacs thing. – Drew Jun 5 '17 at 14:03
0

It is a GTK3 thing not GTK2.

The culprit was a theme I am using.

In my active gtk theme ~/.themes/*/gtk3.0/ there was a file which stated:

.menubar {   
    -GtkWidget-window-dragging: true;

One needs to change this one line to: -GtkWidget-window-dragging: false;

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.