Doom-emacs: Need doom/toggle-maximized command

Created on 1 Feb 2018  Â·  16Comments  Â·  Source: hlissner/doom-emacs


Observed behavior

toggle-frame-maximized function not work on OSX.

Expected behavior

doom/toggle-fullscree can work on OSX, but sometimes frame-maximized is good
choice.

new interface keybinds resolved-elsewhere

Most helpful comment

Where possible, I recommend avoiding the customize API. You can accomplish the same with:

(add-to-list 'initial-frame-alist '(fullscreen . maximized))

All 16 comments

I also have the issue, under windows sub linux system.

@xarthurx @driftcrow What version of Emacs are you two running?

toggle-frame-{fullscreen,maximized} appear to work correctly on MacOS on Emacs 25.3 and 26 (using the emacs-plus formula via homebrew), and on 27 on linux. In fact, I was considering removing doom/toggle-fullscreen as is now redundant (it used to be necessary back in the Emacs 24 days on MacOS because I hated the native fullscreen, and wanted the old behavior).

Does M-; (set-frame-parameter (selected-frame) 'fullscreen 'maximized) not work for either of you? If it doesn't, I'm not sure what else I could do, besides resizing the window manually, which is sure to be much buggier.

@hlissner
Emacs 25.3 on Windows WSL (sub linux system, so actually ubuntu)
it works, but not properly.
So on my computer, it changes the frame size to the resolution, but not place it to take the whole screen. So a part of the frame is out of the screen. (I think it resize from the left top corner.)

Also, fullscreen and maximized behaves the same.

I moved to doom-emacs from spacemacs, and the fullscreen on that works properly, also remove the border properly. Hope this can be a reference for the implementation?

@xarthurx What about fullboth?

@hlissner Not sure if I understand.
Didn't find that command...

Sorry. What happens when you try M-; (set-frame-parameter (selected-frame) 'fullscreen 'fullboth)?

M-x eval-expression RET (set-frame-parameter (selected-frame) 'fullscreen 'fullboth) is the full command in case your M-; isn't bound to eval-expression.

Same effect.

On 1 February 2018 at 23:40, Henrik Lissner notifications@github.com
wrote:

Sorry. What happens when you try M-; (set-frame-parameter
(selected-frame) 'fullscreen 'fullboth)?

M-x eval-expression RET (set-frame-parameter (selected-frame) 'fullscreen
'fullboth) is the full comment in case your M-; isn't bound to
eval-expression.

—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/hlissner/doom-emacs/issues/397#issuecomment-362426233,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AB1TVvPTZgQEHqM2v7sO99Mlg7urCo1pks5tQj1OgaJpZM4R1nRy
.

--
MA Zhao

"SAVE PAPER - PLEASE THINK BEFORE YOU PRINT!"

any screenshot?
anyway I won't expect that to work even properly... I think it's more of a problem of how the X server communicates with the windows subsystem and eventually with Windows itself.

my doom/info

DOOM Doctor
Running Emacs v25.3.1, commit 54d21851381b4276410b26ce61e15d1849464b27

shell: /usr/local/bin/bash
Compiled with:
  JPEG RSVG IMAGEMAGICK NOTIFY ACL GNUTLS LIBXML2 ZLIB
  TOOLKIT_SCROLL_BARS NS MODULES
uname -a:
  Darwin Ambit 17.3.0 Darwin Kernel Version 17.3.0: Thu Nov 9 18:09:22
  PST 2017; root:xnu-4570.31.3~1/RELEASE_X86_64 x86_64

Attempt to load DOOM: success! Loaded v2.0.9
Revision 1e9b49239922b19074201a96b99989849ae14312

----

test-emacs
test-windows
test-fonts
Found font material-design-icons.ttf
Found font weathericons.ttf
Found font octicons.ttf
Found font fontawesome.ttf
Found font file-icons.ttf
Found font all-the-icons.ttf
test-gnutls
test-tls
Validated https://elpa.gnu.org
Validated https://melpa.org
Successfully rejected https://self-signed.badssl.com
Successfully rejected https://wrong.host.badssl.com/
test-tar
Everything seems fine, happy Emacs’ing!

toggle-frame-fullscreen works fine.

toggle-frame-maximized/M-; (set-frame-parameter (selected-frame) 'fullscreen 'maximized) not work .

@driftcrow If you set (setq frame-resize-pixelwise t), does that improve the behavior of toggle-frame-maximized?

@hlissner still have no effect

I'm afraid this isn't a Doom or Elisp issue. It's either an internal Emacs issue or one with the X server on the windows subsystem. I can't reproduce it on MacOS 10.11 or Linux. Perhaps it's a High Sierra issue? I can only test on El Capitan.

I had a look at spacemacs' fullscreen implementation and it is essentially the same as mine, so they shouldn't behave differently. If the fullscreen frame parameter doesn't work for you (which is what all fullscreen/maximize implementations use), then we have no other option, besides manually adjusting the frame width, height, and position in elisp, which is non-trivial (and I can't test it in your environment).

yeah , something is strange, I had look at spacemacs' fullscreen implementation too, and found nothing of different. but spacemacs can toggle-maximized normal on my MACOS

@hlissner I got the reason, for appearance I install emacs-plus use --with-no-title-bars option before. today I reinstall emacs-plus use not addition option, then emacs toggle-frame-maximized works fine.

I tried methods above, and they didn't quite work. What helped me on Mac OS and Emacs 26.3, was

(custom-set-variables
 '(initial-frame-alist (quote ((fullscreen . maximized)))))

I just added it to my .doom.d/config.el.

Where possible, I recommend avoiding the customize API. You can accomplish the same with:

(add-to-list 'initial-frame-alist '(fullscreen . maximized))
Was this page helpful?
0 / 5 - 0 ratings

Related issues

pieterdd picture pieterdd  Â·  3Comments

idoo picture idoo  Â·  3Comments

luisenrike picture luisenrike  Â·  3Comments

laishulu picture laishulu  Â·  3Comments

governorgoat picture governorgoat  Â·  3Comments