Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macOS: mode-line disappear in EAF browser when Emacs is open in full-screen mode #834

Open
taquangtrung opened this issue Aug 27, 2021 · 7 comments
Labels
help wanted Extra attention is needed

Comments

@taquangtrung
Copy link
Contributor

Hi,

Describe the bug
When I run Emacs in full-screen mode and open a webpage by EAF browser, the mode-line disappear

To Reproduce

Run Emacs on macOS, press F11 to go to full-screen mode. Then open a webpage by eaf-search-it and type "testing"

Here is the screenshot showing that the mode-line disappear:

Screenshot 2021-08-27 at 9 04 03 AM

Expected behavior

If I don't use the full-screen mode, then the mode-line can be displayed correctly.

Screenshot 2021-08-27 at 9 03 52 AM

Versions (please complete the following info):

  • Distro and DE/WM: macOS Big Sur 11.3
  • Versions of Dependencies: eaf-20210826.100
  • M-x emacs-version: 27.2
@lhpfvs
Copy link
Contributor

lhpfvs commented Aug 27, 2021

Which Emacs version do you use, emacs-mac or emacs-plus? I guess this is because of the height of the title bar. Currently, we don't handle the event of showing and hiding the title bar.

@taquangtrung
Copy link
Contributor Author

taquangtrung commented Aug 27, 2021

@lhpfvs: I tested on both Emacs Mac Port and Emacs for Mac OS X, the problem still occurs on full-screen mode (F11)\

Notice that there is a blank line on top of EAF browser (in the first attached image). I think might be due to that line, the webpage is pushed lower and cover the mode-line.

@Dima-369
Copy link
Contributor

The missing height at the top is exactly the macOS menu bar height.

With this patched defun, at least the mode-line is still visible for me in macOS 10.14.6 but it hardcodes the menu bar height and I think it changes slightly across macOS versions.

(defun eaf-get-window-allocation (&optional window)
  "Get WINDOW allocation.

Patches:
- subtract 23px from the height which is the macOS 10.14.6 menu bar height"
  (let* ((window-edges (window-pixel-edges window))
         (x (nth 0 window-edges))
         (y (+ (nth 1 window-edges)
               (if (version< emacs-version "27.0")
                   (window-header-line-height window)
                 (window-tab-line-height window))))
         (w (- (nth 2 window-edges) x))
         (h (- (nth 3 window-edges) (window-mode-line-height window) y
               (if (and (eq system-type 'darwin)
                        (equal (frame-parameter nil 'fullscreen) 'fullboth))
                   23
                 0))))
    (list x y w h)))

It still has the 23px margin at the top though:

Fullscreen

image

Maximized

image

@Dima-369
Copy link
Contributor

I also tried to hardcode a 0 for y in (eaf-get-window-allocation) but it does not change anything. There is still this menu bar gap at the top.

I think the problem is that Emacs kind of emulates full-screen behavior without really being in native macOS full-screen which is nice because there is no annoying window switch animation in macOS.

But the EAF Python windows do not (I am not even sure if they can) behave this way and are thus forced below the macOS menu bar.

@Dima-369
Copy link
Contributor

I noticed that when you check Automatically hide and show the menu bar in the General System Settings in macOS that the gap at the top disappears!

image

With the setting checked, the EAF Python windows then correctly take up all the height:

Personally, this is not an option for me as I have certain notifications in the macOS menu bar, but it might be a good solution for others!

image

@manateelazycat manateelazycat added the help wanted Extra attention is needed label Dec 20, 2021
@altunkan
Copy link

altunkan commented Aug 4, 2022

any update on this issue?

@manateelazycat
Copy link
Member

In newest version has function eaf--get-titlebar-height

(defun eaf--get-titlebar-height ()

Maybe some mac user can fix this issue by add mac branch in eaf--get-titlebar-height

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants