Open maker2413 opened 2 years ago
I'm not all that great at lisp but here is a link to a good entrypoint into the stumpwm logic to do this: https://github.com/stumpwm/stumpwm/blob/ff6cb73f48f0df4285948f1009ef3b285c78b351/tile-window.lisp#L120-L136
The functions #'exwm-layout-unset-fullscreen
and #'exwm-layout-toggle-fullscreen
will take a fullscreen window such as a youtube video and shrink it into its associated Emacs window.
Since the modeline is not available in a fullscreen window (as fas as I know), you will need to bind these functions to a key sequence that you can execute with the fullscreen window selected.
I don't know if there is a way to prevent windows from going completely fullscreen in the first place, but I think that would be a nice option to override many apps such as games that default to a full screen window.
Thanks @eval-on-point for pointing this out, but maybe a used the wrong terminology, but this isn't what I meant. I was under the impression that in emacs terminology windows are the actual panes that fill a frame. What I am wanting is to split my frame into two windows and fullscreen an application within its window ie: it would be a fullscreened application that takes up half of my screen and not the entire screen.
This is what I'm basing my terminology off of: https://wikemacs.org/wiki/Emacs_Terminology.
Here is also an example of what this looks like in stumpwm: https://github.com/stumpwm/stumpwm/pull/974 for a better picture.
I don't quite have the elisp skills to pull this off on my own at the moment, but I would that this is a feature that has to be implemented to pull off this workflow from what I saw looking through the repo.
@maker2413: I use "window" to refer to Emacs windows and "X window" to refer to... X windows.
I think this is an interesting feature, I'm not sure what it'd take to implement it.
@medranocalvo Thanks for adding those labels and for providing the terminology tips!
I am not sure about a general solution, but your specific use case (a youtube video or similar full screen browser video being contained within an Emacs window) is solved by the procedure I've described above. It is kind of hacky because the video's window will first be fullscreened, then you will call #'exwm-layout-unset-fullscreen
on it. I just wanted to clarify for future readers.
Here is a screenshot of what it looks like:
Hey @eval-on-point thanks for providing this, sorry I didn't understand the first time you posted it. This work around does give me the functionality I was asking for. I'll still leave this issue open in case anyone with more elisp experience than myself wants to take a crack a more proper solution.
Hey I circled back to this after not thinking about it for a few months and I think I've gotten closer to a solution to implement this. I modified the exwm-workspace--get-geometry function found here: https://github.com/ch11ng/exwm/blob/1c706daeb089d8f9c50eeecb898cad6336f0e3e6/exwm-workspace.el#L289-L296 to use window-pixel-width
and window-pixel-height
as opposed to x-display-pixel-width
and x-display-pixel-height
. This does limit fullscreen applications to the window they currently exist in and this does work with youtube videos or video games. However being that this does disable actually being able to fullscreen an application I wouldn't consider this a proper fix still in it's current state. I think having a way to specify a list of applications that should only fullscreen in their perspective window and have a way to override that even for an application in the list with a keybinding would be a more proper implementation, but I wanted to share what I have found and potentially get other people's input. Here is the code snippet I have in my config currently:
(defun exwm-workspace--get-geometry (frame)
"Return the geometry of frame FRAME."
(or (frame-parameter frame 'exwm-geometry)
(make-instance 'xcb:RECTANGLE
:x (window-pixel-left)
:y (window-pixel-top)
:width (window-pixel-width)
:height (window-pixel-height))))
I want to attempt to do a more proper implementation when I get time so let me know if you think there is a better way than what I suggested so far.
Forgive me if I am using the wrong terminology, but is there currently a way to fullscreen a video or an application for that matter to take up the entire window within the current emacs frame as opposed to taking up the whole screen? My exact use case is that I would like a way to fullscreen a youtube video and have it use all of the screen real estate of its window without taking up the whole frame of the workspace.
Ideally there would be a function to called say
exwm-fullscreen-in-window
that could be set to a keybinding that would toggle whether window is fullscreened in the current window or the entire frame like default.I had similar functionality setup in stumpwm, but stumpwm doesn't give me the same emacs-centric workflow that I get in exwm so I am trying to move back.