mirror of
https://github.com/kovidgoyal/kitty.git
synced 2026-05-13 08:26:56 +00:00
Prevent minimize/maximize/fullscreen for layer shell windows
This commit is contained in:
parent
3c4a8a1e7e
commit
ca30b4196b
2 changed files with 5 additions and 5 deletions
|
|
@ -1963,7 +1963,7 @@ _glfwPlatformSetLayerShellConfig(_GLFWwindow* window, const GLFWLayerShellConfig
|
||||||
CGFloat x = NSMinX(screen.visibleFrame), y = NSMinY(screen.visibleFrame);
|
CGFloat x = NSMinX(screen.visibleFrame), y = NSMinY(screen.visibleFrame);
|
||||||
[window->ns.object setFrame:NSMakeRect(x, y, (CGFloat)width, (CGFloat)height) display:YES];
|
[window->ns.object setFrame:NSMakeRect(x, y, (CGFloat)width, (CGFloat)height) display:YES];
|
||||||
return true;
|
return true;
|
||||||
#undef config
|
#undef config
|
||||||
}
|
}
|
||||||
|
|
||||||
void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title)
|
void _glfwPlatformSetWindowTitle(_GLFWwindow* window, const char* title)
|
||||||
|
|
|
||||||
|
|
@ -939,7 +939,7 @@ do_toggle_fullscreen(OSWindow *w, unsigned int flags, bool restore_sizes) {
|
||||||
|
|
||||||
static bool
|
static bool
|
||||||
toggle_fullscreen_for_os_window(OSWindow *w) {
|
toggle_fullscreen_for_os_window(OSWindow *w) {
|
||||||
if (w && w->handle) {
|
if (w && w->handle && !w->is_layer_shell) {
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
if (!OPT(macos_traditional_fullscreen)) return do_toggle_fullscreen(w, 1, false);
|
if (!OPT(macos_traditional_fullscreen)) return do_toggle_fullscreen(w, 1, false);
|
||||||
#endif
|
#endif
|
||||||
|
|
@ -961,7 +961,7 @@ is_os_window_fullscreen(OSWindow *w) {
|
||||||
static bool
|
static bool
|
||||||
toggle_maximized_for_os_window(OSWindow *w) {
|
toggle_maximized_for_os_window(OSWindow *w) {
|
||||||
bool maximized = false;
|
bool maximized = false;
|
||||||
if (w && w->handle) {
|
if (w && w->handle && !w->is_layer_shell) {
|
||||||
if (glfwGetWindowAttrib(w->handle, GLFW_MAXIMIZED)) {
|
if (glfwGetWindowAttrib(w->handle, GLFW_MAXIMIZED)) {
|
||||||
glfwRestoreWindow(w->handle);
|
glfwRestoreWindow(w->handle);
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -974,7 +974,7 @@ toggle_maximized_for_os_window(OSWindow *w) {
|
||||||
|
|
||||||
static void
|
static void
|
||||||
change_state_for_os_window(OSWindow *w, int state) {
|
change_state_for_os_window(OSWindow *w, int state) {
|
||||||
if (!w || !w->handle) return;
|
if (!w || !w->handle || w->is_layer_shell) return;
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case WINDOW_MAXIMIZED:
|
case WINDOW_MAXIMIZED:
|
||||||
glfwMaximizeWindow(w->handle);
|
glfwMaximizeWindow(w->handle);
|
||||||
|
|
@ -1920,7 +1920,7 @@ cocoa_minimize_os_window(PyObject UNUSED *self, PyObject *args) {
|
||||||
if (!PyArg_ParseTuple(args, "|K", &os_window_id)) return NULL;
|
if (!PyArg_ParseTuple(args, "|K", &os_window_id)) return NULL;
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
OSWindow *w = os_window_id ? os_window_for_id(os_window_id) : current_os_window();
|
OSWindow *w = os_window_id ? os_window_for_id(os_window_id) : current_os_window();
|
||||||
if (!w || !w->handle) Py_RETURN_NONE;
|
if (!w || !w->handle || w->is_layer_shell) Py_RETURN_NONE;
|
||||||
if (!glfwGetCocoaWindow) { PyErr_SetString(PyExc_RuntimeError, "Failed to load glfwGetCocoaWindow"); return NULL; }
|
if (!glfwGetCocoaWindow) { PyErr_SetString(PyExc_RuntimeError, "Failed to load glfwGetCocoaWindow"); return NULL; }
|
||||||
void *window = glfwGetCocoaWindow(w->handle);
|
void *window = glfwGetCocoaWindow(w->handle);
|
||||||
if (!window) Py_RETURN_NONE;
|
if (!window) Py_RETURN_NONE;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue