ch11ng / exwm

Emacs X Window Manager
2.85k stars 136 forks source link

No mode-line on some floating windows #220

Open bvk opened 7 years ago

bvk commented 7 years ago

In some X11 applications that use multiple windows (in my case Zoom Meeting app), EXWM doesn't display the mode-line on child-windows.

Since these applications are primarily driven by Mouse, not having a mode-line when child-window is active forces me to switch from mouse to the keyboard to do operations like: switching to another work-space, closing the child window, moving window to another workspace, etc.

When compared with other, normal window managers, they provide WM operations through the frame around child window (at the least a close child-window button). In EXWM case, if we display mode-line on these, users could invoke the mode-line menu for EXWM and do certain WM operations on child-windows using the Mouse. If #219 is available, users can close the child-window through the mode-line menu.

ch11ng commented 7 years ago

Does (add-hook 'exwm-floating-setup-hook #'exwm-layout-show-mode-line) work?

bvk commented 7 years ago

Yes, this works. Thank you.

But since child window is small, I couldn't see the EXWM on the mode-line. It was cut off due to window size, so I had to change the mode-line-format to get the desired effect:

`` (add-hook 'exwm-floating-setup-hook

  (lambda ()

    (progn

      (setq mode-line-format

        (list mode-line-modes mode-line-buffer-identification))

      (exwm-layout-show-mode-line))))

``

Since some fields in the mode-line-format doesn't make sense (position, modified flag, etc.) with X11 windows, perhaps, EXWM could introduce exwm-mode-line variable with better defaults in future.

bvk commented 7 years ago

Hi,

I would like to reopen this issue because the following fix doesn't always work. For example, virt-manager program opens floating windows which has a black-bar at the bottom instead of the mode-line. Also, virt-manager floating windows don't seem to get updated after few seconds of use -- but this happens only with virt-manager program.

Does (add-hook 'exwm-floating-setup-hook #'exwm-layout-show-mode-line) work?

Thanks, BVK Chaitanya

ch11ng commented 7 years ago

Is this always reproducible? I tried with virt-manager 1.4.0 and I should say it works though not perfect.

bvk commented 7 years ago

Okay, after trying all combinations for like 30 minutes, I found that mode-line is displayed if I open the X11 program from the workspace on the laptop display, but not when I open the X11 program from the workspace on the external monitor :)

8dfc763a-fcfe-4dab-bffa-24d2a23e90b2

bvk commented 7 years ago

Ok, this attached picture could be helpful in identify the location of the bug.

Notice that mode-line on the external monitor is visible after the black block, after an offset. I suspect that width of the black block may be basically width of my laptop screen -- which is on the left-side of external monitor as per my xrandr configuration.

423e0ac5-cc82-4b57-9173-4500488c5ccb

ch11ng commented 7 years ago

The last image reminds me of #163 for which c22f35620f0db3e86f4b0678a29dc3eee48df4d9 was made. It seems the problem only occurs when there is a panel (could you verify that?) and unfortunately the workaround does not always work.

bvk commented 7 years ago

Did you mean systemtray by "panel"? If yes, I disabled the EXWM systemtray extension and related configuration and still faced with the same issue.

bvk commented 7 years ago

If you meant gnome-panel or something similar, I don't use them. My xsession is as follows:

#!/bin/bash

# Fix DPI for bigger fonts.
xrandr --dpi 174

# Load X11/xterm color theme.
xrdb -merge ${HOME}/config/xrdb/Xdefaults
xrdb -merge ${HOME}/config/xrdb/solarized.xrdb

# Set default wallpaper.
# Feh --bg-scale ${HOME}/config/feh/wallpaper

# Disable access control
xhost +SI:localuser:$USER

# Start few applets.
nm-applet &
blueman-applet &
pasystray &

# Start Emacs
exec /home/bvk/tools/bin/emacs -mm
ch11ng commented 7 years ago

Could you provide the output of xwininfo -tree -root? I think the Emacs frame (which is not managed by EXWM) moved itself. BTW does replace this line with (when t fix this problem?

bvk commented 7 years ago

Below is the "xwininfo -tree -root" output. I ran the command using M-& command when the Open window of google-chrome is active with the black-bar in place of the mode-line. My laptop screen (eDP1) has 2560x1600 resolution and to it's right is external monitor (HDMI2) with 2560x1400 resolution. Attached picture shows that open window is occupying entire width of my external monitor -- which is another annoying issue, but is lower priority.

c379825d-47ba-4058-bff9-79d9dc0a94b9

Since the black-bar is occupying the display width, this monitor doesn't show the mode-line shift in action; I can retry and report when I have access to the wider 4K monitor later.

Also, I will try (when t and report sometime later. Thank you.

=== xwininfo follows ===

xwininfo: Window id: 0x18c (the root window) "EXWM"

Root window id: 0x18c (the root window) "EXWM" Parent window id: 0x0 (none) 31 children: 0x1400077 (has no name): () 1x1+-1+-1 +-1+-1 0x1600049 (has no name): () 566x47+2871+27 +2871+27 0x120002b (has no name): () 2560x1440+2560+0 +2560+0 3 children: 0x120003d (has no name): () 2576x1109+0+151 +2560+151 2 children: 0x140002d "Open File": ("google-chrome" "Google-chrome") 2576x1080+0+0 +2561+152 1 child: 0x140002e (has no name): () 1x1+-1+-1 +2560+151 0x120003e (has no name): () 2576x1109+0+0 +2561+152 1 child: 0x100184a "EXWM": ("emacs" "Emacs") 2576x1109+2560+0 +5121+152 2 children: 0x100184e (has no name): () 2576x1109+0+0 +5121+152 0x100184b (has no name): () 1x1+-1+-1 +5120+151 0x120003b (has no name): () 2560x1382+0+0 +2560+0 1 child: 0x1600001 "Re: [ch11ng/exwm] No mode-line on some floating windows (#220) - bvkchaitanya@gmail.com - Gmail - Google Chrome": ("google-chrome" "Google-chrome") 2560x1382+0+0 +2560+0 0x120002a (has no name): () 2560x1440+0+0 +2560+0 1 child: 0x10001b6 " Minibuf-1": ("emacs" "Emacs") 2560x1440+0+0 +2560+0 2 children: 0x10001ba (has no name): () 2560x1440+0+0 +2560+0 0x10001b7 (has no name): () 1x1+-1+-1 +2559+-1 0x120002d (has no name): () 2560x1440+2560+0 +2560+0 2 children: 0x120003c (has no name): () 2560x1382+0+0 +2560+0 1 child: 0x1800009 "cloudsimple@atlas: ~/public": ("urxvt" "URxvt") 2560x1382+0+0 +2560+0 11 children: 0x18000b2 "bvk@zion: ~/cloudsimple/storelink.repo": ("urxvt" "URxvt") 2560x1343+0+39 +2560+39 1 child: 0x18000b7 (has no name): () 2540x1326+2+2 +2562+41 0x18000a2 "bvk@zion: ~": ("urxvt" "URxvt") 2560x1343+0+39 +2560+39 1 child: 0x18000a7 (has no name): () 2540x1326+2+2 +2562+41 0x1800092 "bvk@zion: ~": ("urxvt" "URxvt") 2560x1343+0+39 +2560+39 1 child: 0x1800097 (has no name): () 2540x1326+2+2 +2562+41 0x1800082 "bvk@zion: ~": ("urxvt" "URxvt") 2560x1343+0+39 +2560+39 1 child: 0x1800087 (has no name): () 2540x1326+2+2 +2562+41 0x1800072 "bvk@zion: ~": ("urxvt" "URxvt") 2560x1343+0+39 +2560+39 1 child: 0x1800077 (has no name): () 2540x1326+2+2 +2562+41 0x1800062 "bvk@zion: ~": ("urxvt" "URxvt") 2560x1343+0+39 +2560+39 1 child: 0x1800067 (has no name): () 2540x1326+2+2 +2562+41 0x1800052 "bvk@zion: ~": ("urxvt" "URxvt") 2560x1343+0+39 +2560+39 1 child: 0x1800057 (has no name): () 2540x1326+2+2 +2562+41 0x1800042 "bvk@zion: ~": ("urxvt" "URxvt") 2560x1343+0+39 +2560+39 1 child: 0x1800047 (has no name): () 2540x1326+2+2 +2562+41 0x1800030 "cloudsimple@atlas: ~/public": ("urxvt" "URxvt") 2560x1343+0+39 +2560+39 1 child: 0x1800035 (has no name): () 2540x1326+2+2 +2562+41 0x1800014 "cloudsimple@atlas: ~/bvk": ("urxvt" "URxvt") 2560x1343+0+39 +2560+39 1 child: 0x1800019 (has no name): () 2540x1326+2+2 +2562+41 0x180000e (has no name): () 2560x1365+0+0 +2560+0 0x120002c (has no name): () 2560x1440+0+0 +2560+0 1 child: 0x100022f " EXWM": ("emacs" "Emacs") 2560x1440+0+0 +2560+0 2 children: 0x1000233 (has no name): () 2560x1440+0+0 +2560+0 0x1000230 (has no name): () 1x1+-1+-1 +2559+-1 0x1200029 (has no name): () 2560x1440+2560+0 +2560+0 1 child: 0x1200028 (has no name): () 2560x1440+0+0 +2560+0 1 child: 0x100013c "builder-wo-spdk.sh": ("emacs" "Emacs") 2560x1440+0+0 +2560+0 2 children: 0x1000140 (has no name): () 2560x1440+0+0 +2560+0 0x100013d (has no name): () 1x1+-1+-1 +2559+-1 0x120002f (has no name): () 2560x1440+2560+0 +2560+0 1 child: 0x120002e (has no name): () 2560x1440+0+0 +2560+0 1 child: 0x10002a8 "default.org": ("emacs" "Emacs") 2560x1440+0+0 +2560+0 2 children: 0x10002ac (has no name): () 2560x1440+0+0 +2560+0 0x10002a9 (has no name): () 1x1+-1+-1 +2559+-1 0x1400027 "google-chrome": ("google-chrome" "Google-chrome") 200x200+0+0 +0+0 1 child: 0x1400028 (has no name): () 1x1+-1+-1 +-1+-1 0x1600048 "Chromium clipboard": () 10x10+-100+-100 +-100+-100 0x1a0000b (has no name): () 1x1+0+0 +0+0 0x1c00001 (has no name): () 1x1+0+0 +0+0 0x1600039 (has no name): () 1x1+0+0 +0+0 0x1400003 "google-chrome": ("google-chrome" "Google-chrome") 200x200+0+0 +0+0 1 child: 0x1400004 (has no name): () 1x1+-1+-1 +-1+-1 0x1400001 "google-chrome": ("google-chrome" "Google-chrome") 10x10+10+10 +10+10 1 child: 0x1400002 (has no name): () 1x1+-1+-1 +9+9 0x1200039 (has no name): () 2560x1440+2560+0 +2560+0 1 child: 0x1200038 (has no name): () 2560x1440+0+0 +2560+0 1 child: 0x1000505 "default.org": ("emacs" "Emacs") 2560x1440+0+0 +2560+0 2 children: 0x1000509 (has no name): () 2560x1440+0+0 +2560+0 0x1000506 (has no name): () 1x1+-1+-1 +2559+-1 0x120003a (has no name): () 1x1+-1+-1 +-1+-1 0x1200027 (has no name): () 2560x1600+0+0 +0+0 1 child: 0x1200026 (has no name): () 2560x1600+0+0 +0+0 1 child: 0x100006f "default.org": ("emacs" "Emacs") 2560x1600+0+0 +0+0 2 children: 0x1000073 (has no name): () 2560x1600+0+0 +0+0 0x1000070 (has no name): () 1x1+-1+-1 +-1+-1 0x1200037 (has no name): () 2560x1440+2560+0 +2560+0 1 child: 0x1200036 (has no name): () 2560x1440+0+0 +2560+0 1 child: 0x100048c "default.org": ("emacs" "Emacs") 2560x1440+0+0 +2560+0 2 children: 0x1000490 (has no name): () 2560x1440+0+0 +2560+0 0x100048d (has no name): () 1x1+-1+-1 +2559+-1 0x1200035 (has no name): () 2560x1440+2560+0 +2560+0 1 child: 0x1200034 (has no name): () 2560x1440+0+0 +2560+0 1 child: 0x1000413 "default.org": ("emacs" "Emacs") 2560x1440+0+0 +2560+0 2 children: 0x1000417 (has no name): () 2560x1440+0+0 +2560+0 0x1000414 (has no name): () 1x1+-1+-1 +2559+-1 0x1200033 (has no name): () 2560x1440+2560+0 +2560+0 1 child: 0x1200032 (has no name): () 2560x1440+0+0 +2560+0 1 child: 0x100039a "default.org": ("emacs" "Emacs") 2560x1440+0+0 +2560+0 2 children: 0x100039e (has no name): () 2560x1440+0+0 +2560+0 0x100039b (has no name): () 1x1+-1+-1 +2559+-1 0x1200031 (has no name): () 2560x1440+2560+0 +2560+0 1 child: 0x1200030 (has no name): () 2560x1440+0+0 +2560+0 1 child: 0x1000321 "default.org": ("emacs" "Emacs") 2560x1440+0+0 +2560+0 2 children: 0x1000325 (has no name): () 2560x1440+0+0 +2560+0 0x1000322 (has no name): () 1x1+-1+-1 +2559+-1 0x1200001 "EXWM": () 1x1+0+0 +0+0 0xe0000f "blueman-applet": ("blueman" "blueman") 48x48+0+0 +0+0 1 child: 0xe00010 (has no name): () 1x1+-1+-1 +-1+-1 0x1000098 (has no name): ("emacs" "Emacs") 20x48+0+0 +0+0 1 child: 0x1000099 (has no name): () 1x1+-1+-1 +-1+-1 0x100007b (has no name): () 1x1+-1+-1 +-1+-1 0xa0000c "PulseAudio system tray": ("pasystray" "Pasystray") 16x16+0+0 +0+0 1 child: 0xa0000d (has no name): () 1x1+-1+-1 +-1+-1 0x1000001 "emacs": ("emacs" "Emacs") 10x10+10+10 +10+10 1 child: 0x1000002 (has no name): () 1x1+-1+-1 +9+9 0x800003 "NetworkManager Applet": ("nm-applet" "Nm-applet") 16x16+0+0 +0+0 1 child: 0x800004 (has no name): () 1x1+-1+-1 +-1+-1 0xe00001 "blueman-applet": ("blueman-applet" "Blueman-applet") 10x10+10+10 +10+10 1 child: 0xe00002 (has no name): () 1x1+-1+-1 +9+9 0x800001 "NetworkManager Applet": ("nm-applet" "Nm-applet") 10x10+10+10 +10+10 1 child: 0x800002 (has no name): () 1x1+-1+-1 +9+9 0xa00001 "pasystray": ("pasystray" "Pasystray") 10x10+10+10 +10+10 1 child: 0xa00002 (has no name): () 1x1+-1+-1 +9+9 0x400001 (has no name): () 10x10+-20+-20 +-20+-20

bvk commented 7 years ago

The (when t change has fixed the issue for me.

bvk commented 7 years ago

Below is the "xwininfo -tree -root" output when google-chrome's open-file window displays the black-bar followed by the mode-line at an offset to the right.

I ran the command using M-& command when the Open window of google-chrome is active with the black-bar in place of the mode-line. My laptop screen (eDP1) has 2560x1600 resolution and to it's right is external monitor (DP1) with 3840x2160 resolution.

xwininfo: Window id: 0x1a8 (the root window) "EXWM"

Root window id: 0x1a8 (the root window) "EXWM" Parent window id: 0x0 (none) 29 children: 0x1600071 (has no name): () 1x1+-1+-1 +-1+-1 0x1a0000b (has no name): () 1x1+0+0 +0+0 0x1c00001 (has no name): () 1x1+0+0 +0+0 0x1800039 (has no name): () 1x1+0+0 +0+0 0x1600003 "google-chrome": ("google-chrome" "Google-chrome") 200x200+0+0 +0+0 1 child: 0x1600004 (has no name): () 1x1+-1+-1 +-1+-1 0x1600001 "google-chrome": ("google-chrome" "Google-chrome") 10x10+10+10 +10+10 1 child: 0x1600002 (has no name): () 1x1+-1+-1 +9+9 0x120002b (has no name): () 3840x2160+2560+0 +2560+0 3 children: 0x120003e (has no name): () 2624x1109+616+511 +3176+511 2 children: 0x160020c "Open File": ("google-chrome" "Google-chrome") 2624x1080+0+0 +3177+512 1 child: 0x160020d (has no name): () 1x1+-1+-1 +3176+511 0x120003f (has no name): () 2624x1109+0+0 +3177+512 1 child: 0xc006ef "Google-chrome<2>": ("emacs" "Emacs") 2624x1109+2560+0 +5737+512 2 children: 0xc006f3 (has no name): () 2624x1109+0+0 +5737+512 0xc006f0 (has no name): () 1x1+-1+-1 +5736+511 0x120003b (has no name): () 3840x2102+0+0 +2560+0 1 child: 0x1800001 "No mode-line on some floating windows · Issue #220 · ch11ng/exwm - Google Chrome": ("google-chrome" "Google-chrome") 3840x2102+0+0 +2560+0 0x120002a (has no name): () 3840x2160+0+0 +2560+0 1 child: 0xc001b9 " Minibuf-1": ("emacs" "Emacs") 3840x2160+0+0 +2560+0 2 children: 0xc001bd (has no name): () 3840x2160+0+0 +2560+0 1 child: 0x1400002 "EXWM system tray embedder": () 80x24+3760+2136 +6320+2136 3 children: 0xa0000c "PulseAudio system tray": ("pasystray" "Pasystray") 24x24+2+0 +6322+2136 1 child: 0xa0000d (has no name): () 1x1+-1+-1 +6321+2135 0x800003 "NetworkManager Applet": ("nm-applet" "Nm-applet") 24x24+28+0 +6348+2136 1 child: 0x800004 (has no name): () 1x1+-1+-1 +6347+2135 0x100000f "blueman-applet": ("blueman" "blueman") 24x24+54+0 +6374+2136 1 child: 0x1000010 (has no name): () 1x1+-1+-1 +6373+2135 0xc001ba (has no name): () 1x1+-1+-1 +2559+-1 0xa00011 (has no name): () 1x1+-1+-1 +-1+-1 0x800008 (has no name): () 1x1+-1+-1 +-1+-1 0x1000014 (has no name): () 1x1+-1+-1 +-1+-1 0x1400001 "EXWM system tray selection owner": () 1x1+0+0 +0+0 0x120003a (has no name): () 1x1+-1+-1 +-1+-1 0x1200027 (has no name): () 2560x1600+0+0 +0+0 1 child: 0x1200026 (has no name): () 2560x1600+0+0 +0+0 1 child: 0xc0006f "default.org": ("emacs" "Emacs") 2560x1600+0+0 +0+0 2 children: 0xc00073 (has no name): () 2560x1600+0+0 +0+0 0xc00070 (has no name): () 1x1+-1+-1 +-1+-1 0x1200039 (has no name): () 3840x2160+2560+0 +2560+0 1 child: 0x1200038 (has no name): () 3840x2160+0+0 +2560+0 1 child: 0xc00508 "default.org": ("emacs" "Emacs") 3840x2160+0+0 +2560+0 2 children: 0xc0050c (has no name): () 3840x2160+0+0 +2560+0 0xc00509 (has no name): () 1x1+-1+-1 +2559+-1 0x1200037 (has no name): () 3840x2160+2560+0 +2560+0 1 child: 0x1200036 (has no name): () 3840x2160+0+0 +2560+0 1 child: 0xc0048f "default.org": ("emacs" "Emacs") 3840x2160+0+0 +2560+0 2 children: 0xc00493 (has no name): () 3840x2160+0+0 +2560+0 0xc00490 (has no name): () 1x1+-1+-1 +2559+-1 0x1200035 (has no name): () 3840x2160+2560+0 +2560+0 1 child: 0x1200034 (has no name): () 3840x2160+0+0 +2560+0 1 child: 0xc00416 "default.org": ("emacs" "Emacs") 3840x2160+0+0 +2560+0 2 children: 0xc0041a (has no name): () 3840x2160+0+0 +2560+0 0xc00417 (has no name): () 1x1+-1+-1 +2559+-1 0x1200033 (has no name): () 3840x2160+2560+0 +2560+0 1 child: 0x1200032 (has no name): () 3840x2160+0+0 +2560+0 1 child: 0xc0039d "default.org": ("emacs" "Emacs") 3840x2160+0+0 +2560+0 2 children: 0xc003a1 (has no name): () 3840x2160+0+0 +2560+0 0xc0039e (has no name): () 1x1+-1+-1 +2559+-1 0x1200031 (has no name): () 3840x2160+2560+0 +2560+0 1 child: 0x1200030 (has no name): () 3840x2160+0+0 +2560+0 1 child: 0xc00324 "default.org": ("emacs" "Emacs") 3840x2160+0+0 +2560+0 2 children: 0xc00328 (has no name): () 3840x2160+0+0 +2560+0 0xc00325 (has no name): () 1x1+-1+-1 +2559+-1 0x120002f (has no name): () 3840x2160+2560+0 +2560+0 1 child: 0x120002e (has no name): () 3840x2160+0+0 +2560+0 1 child: 0xc002ab "default.org": ("emacs" "Emacs") 3840x2160+0+0 +2560+0 2 children: 0xc002af (has no name): () 3840x2160+0+0 +2560+0 0xc002ac (has no name): () 1x1+-1+-1 +2559+-1 0x120002d (has no name): () 3840x2160+2560+0 +2560+0 1 child: 0x120002c (has no name): () 3840x2160+0+0 +2560+0 1 child: 0xc00232 "default.org": ("emacs" "Emacs") 3840x2160+0+0 +2560+0 2 children: 0xc00236 (has no name): () 3840x2160+0+0 +2560+0 0xc00233 (has no name): () 1x1+-1+-1 +2559+-1 0x1200029 (has no name): () 3840x2160+2560+0 +2560+0 1 child: 0x1200028 (has no name): () 3840x2160+0+0 +2560+0 1 child: 0xc0013f "default.org": ("emacs" "Emacs") 3840x2160+0+0 +2560+0 2 children: 0xc00143 (has no name): () 3840x2160+0+0 +2560+0 0xc00140 (has no name): () 1x1+-1+-1 +2559+-1 0x1200001 "EXWM": () 1x1+0+0 +0+0 0xc00098 (has no name): ("emacs" "Emacs") 20x48+0+0 +0+0 1 child: 0xc00099 (has no name): () 1x1+-1+-1 +-1+-1 0xc0007b (has no name): () 1x1+-1+-1 +-1+-1 0x1000001 "blueman-applet": ("blueman-applet" "Blueman-applet") 10x10+10+10 +10+10 1 child: 0x1000002 (has no name): () 1x1+-1+-1 +9+9 0x800001 "NetworkManager Applet": ("nm-applet" "Nm-applet") 10x10+10+10 +10+10 1 child: 0x800002 (has no name): () 1x1+-1+-1 +9+9 0xa00001 "pasystray": ("pasystray" "Pasystray") 10x10+10+10 +10+10 1 child: 0xa00002 (has no name): () 1x1+-1+-1 +9+9 0xc00001 "emacs": ("emacs" "Emacs") 10x10+10+10 +10+10 1 child: 0xc00002 (has no name): () 1x1+-1+-1 +9+9 0x200001 (has no name): () 10x10+-20+-20 +-20+-20

ch11ng commented 7 years ago

From the outputs it's clear that the Emacs frame moved itself. I think it's safe to apply that fix unconditionally for now.

sarg commented 6 years ago

I have found this in exwm-floating--set-floating.

    ;; FIXME: Strangely, the Emacs frame can move itself at this point
    ;;        when there are left/top struts set.  Force resetting its
    ;;        position seems working, but it'd better to figure out why.
    ;; FIXME: This also happens in another case (#220) where the cause is
    ;;        still unclear.
    (exwm--set-geometry outer-id 0 0 nil nil)
    (xcb:flush exwm--connection))

When I fix window size like that (exwm--set-geometry outer-id 0 0 500 500), then this happens https://imgur.com/rUMckG4

If you look at top-left corner of the window, you could see how it slowly moves to the left and down. Maybe this is a emacs bug? My version is GNU Emacs 27.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.22.28) of 2018-02-25, unofficial emacs-snapshot build: http://emacs.secretsauce.net

ch11ng commented 6 years ago

I haven't figured out why.