Replies: 1 comment 1 reply
-
This PR (#1863) should introduce toggle window borderless feature dynamically (not sure if it's necessary). Or the following path is ready to use: ;;;; Toggle Display Borderless
(in-package :lem-sdl2)
(defgeneric lem-if::display-borderless-p (implementation)
(:documentation
"Return `t' if FRAME is borderless, `nil' otherwise.
Default IMPLEMENTATION should return `t' as fallback. ")
(:method (implementation) t)
(:method ((implementation sdl2))
(with-debug ("display-borderless-p")
(display:with-display (display)
(not (null (member :borderless (sdl2:get-window-flags (display:display-window display)))))))))
(defmethod (setf lem-if::display-borderless-p) (boolean implementation)
(declare (ignore boolean implementation)))
(defmethod (setf lem-if::display-borderless-p) (boolean (implementation sdl2))
(declare (ignore implementation))
(with-debug ("(setf lem-if::display-borderless-p)")
(sdl2:in-main-thread ()
(display:with-display (display)
(sdl2-ffi.functions:sdl-set-window-bordered (display:display-window display)
(if boolean 0 1))))))
(in-package :lem-core)
(defun lem-core::display-borderless-p ()
"Get/Set current display if borderless.
Return `t' for borderless (no-titlebar), `nil' for otherwise. "
(lem-if::display-borderless-p (implementation)))
(defun (setf lem-core::display-borderless-p) (boolean)
(setf (lem-if::display-borderless-p (implementation)) boolean))
(define-command toggle-frame-borderless () ()
"Toggles frame borderless. "
(setf (display-borderless-p) (not (display-borderless-p)))) |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In
lem-sdl2::create-display
function, add:borderless
flag insdl2:with-window
could create the Lem window without macOS's titlebar, which is much more nice looking.the code is be like:
Beta Was this translation helpful? Give feedback.
All reactions