ch11ng / exwm

Emacs X Window Manager
2.85k stars 135 forks source link

Applications on workspace 0 don't take full width. #538

Closed sarg closed 5 years ago

sarg commented 5 years ago

My display resolution is 1600x900, but apps on workspace 0 are only 1592x882. Other workspaces aren't affected. I have tried to disable system tray but it didn't help.

xwininfo: Window id: 277 (the root window) "LG3D"

  Root window id: 277 (the root window) "LG3D"
  Parent window id: 0 (none)
     18 children:
     23068673 "EXWM: exwm-systemtray--selection-owner-window": ()  1x1+0+0  +0+0
     20971564 "EXWM: exwm-input--timestamp-window": ()  1x1+-1+-1  +-1+-1
     25165829 "~": ("xterm" "xterm")  1592x882+0+0  +0+0
        1 child:
        8388761 (has no name): ()  1x1+515+421  +515+421
     20971522 "EXWM: exwm--guide-window": ()  1x1+-1+-1  +-1+-1
     20971559 "EXWM workspace 0 frame container": ()  1600x900+0+0  +0+0
        1 child:
        18874687 "xterm – Doom Emacs": ("emacs" "Emacs")  1600x900+0+0  +0+0
           2 children:
           18874691 (has no name): ()  1600x900+0+0  +0+0
              1 child:
              23068674 "EXWM: exwm-systemtray--embedder-window": ()  2x17+1598+883  +1598+883
           18874688 (has no name): ()  1x1+-1+-1  +-1+-1
     20971560 "EXWM workspace 1 frame container": ()  1x1+0+0  +0+0
        1 child:
        18875044 "*doom* – Doom Emacs": ("emacs" "Emacs")  1600x900+0+0  +0+0
           2 children:
           18875048 (has no name): ()  1600x900+0+0  +0+0
           18875045 (has no name): ()  1x1+-1+-1  +-1+-1
     20971562 "EXWM workspace 3 frame container": ()  1x1+0+0  +0+0
        1 child:
        18875705 "*doom* – Doom Emacs": ("emacs" "Emacs")  1600x900+0+0  +0+0
           2 children:
           18875709 (has no name): ()  1600x900+0+0  +0+0
           18875706 (has no name): ()  1x1+-1+-1  +-1+-1
     20971561 "EXWM workspace 2 frame container": ()  1x1+0+0  +0+0
        1 child:
        18875375 "*doom* – Doom Emacs": ("emacs" "Emacs")  1600x900+0+0  +0+0
           2 children:
           18875379 (has no name): ()  1600x900+0+0  +0+0
           18875376 (has no name): ()  1x1+-1+-1  +-1+-1
     20971563 "EXWM workspace 4 frame container": ()  1x1+0+0  +0+0
        1 child:
        18876035 "*doom* – Doom Emacs": ("emacs" "Emacs")  1600x900+0+0  +0+0
           2 children:
           18876039 (has no name): ()  1600x900+0+0  +0+0
           18876036 (has no name): ()  1x1+-1+-1  +-1+-1
     20971521 "EXWM: exwm--wmsn-window": ()  1x1+-1+-1  +-1+-1
     18874727 (has no name): ("emacs" "Emacs")  28x45+0+0  +0+0
        1 child:
        18874728 (has no name): ()  1x1+-1+-1  +-1+-1
     18874700 (has no name): ()  1x1+-1+-1  +-1+-1
     18874369 "emacs": ("emacs" "Emacs")  10x10+10+10  +10+10
     12582913 (has no name): ()  10x10+-20+-20  +-20+-20
     14680067 (has no name): ()  1x1+-1+-1  +-1+-1
     14680065 "Dunst": ("Dunst" "Dunst")  1600x1+0+0  +0+0
     2097153 "xsettingsd": ()  1x1+-1+-1  +-1+-1
     8388612 (has no name): ()  1x1+0+0  +0+0
ch11ng commented 5 years ago

Did you mean the 8 pixel loss in width? From the output of xwininfo I can see nothing abnormal. In exwm-mode margins, fringes and scroll bar are automatically disabled so perhaps there is something else left in the first workspace. Please check with M-: (window-inside-pixel-edges) RET with the first workspace selected.

sarg commented 5 years ago

Yeah, 8 pixels. Output for window-inside-pixel-edges is (0 0 1592 852).

And here is right bottom corner of my screen. You can see, that system tray is located correctly and app window have 8 pixel gray area at its right side. image

sarg commented 5 years ago

Can't reproduce the bug in clean emacs with latest exwm. Maybe the problem is caused by another package.

sarg commented 5 years ago

Removed this from early-init.el, provided by doom-emacs.

;; Prevent the glimpse of un-styled Emacs by setting these early.
(add-to-list 'default-frame-alist '(menu-bar-lines . 0))

After that the problem dissapeared. But the root cause isn't this line, because adding it to clean emacs doesn't lead to reproducing the bug.

ch11ng commented 5 years ago

It looks like the frame has a non-zero sized internal border. Please check with (frame-parameter nil 'border-width) with the first workspace selected.

ch11ng commented 5 years ago

There are two diagrams in (info "(elisp)Window Sizes") and (info "(elisp)Frame Layout") illustrating various UI components of an Emacs window/frame. Basically fringes, margins and scroll bars (all are Emacs window components) are automatically removed by EXWM, while the rest are left to users and you may want to check them.

There is something suspicious in the frame parameters: the frame is positioned at (-1, -1). It should be (0, 0) normally. Is the result the same with a minimal configuration?

sarg commented 5 years ago

I have found that emacs --fullscreen in my Xsession doesn't take full screen space even when exwm is disabled. I have removed that parameter and the problem is gone. I suppose it isn't exwm issue at all, feel free to close it because workaround exist.

ch11ng commented 5 years ago

You don't have to specify that option since EXWM will do that for you (and it does not rely on Emacs's builtin fullscreen support).

paulalesius commented 2 years ago

I'm also experiencing this after logging in and the first EXWM workspace is displayed.

When switching to workspace 1, and back to workspace 0, the issue disappears and the window is aligned to the screen dimensions.

It looks to me like it's caused by emacs being created in a systemd daemon. Once Xorg is started, an emacsclient connects to the daemon socket, the geometrics of the initial frame is a bit off. 2022-01-25-135254_1920x1080_scrot