-
-
Notifications
You must be signed in to change notification settings - Fork 144
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Mac: Handle "Displays have separate Spaces"
- Using JNI, detect whether "Displays have separate Spaces" is enabled in the system settings, and don't try to enable multi-screen spanning if so. (Otherwise, if the viewer tries to create a multi-screen window, only the part of the window on the primary display will be visible. If there is a vertical scrollbar, it will be inaccessible, and if there is a horizontal scrollbar, it will be incorrectly sized.) - To be safe, also don't try to enable multi-screen spanning if the TurboVNC Helper is unavailable (which means that the state of "Displays have separate Spaces" cannot be determined.) - Modify the description of the Span parameter on macOS to document the need to disable "Displays have separate Spaces" in order to use multi-screen spanning.
- Loading branch information
1 parent
c113222
commit 2152fb0
Showing
7 changed files
with
62 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* Copyright (C) 2011-2024 D. R. Commander. All Rights Reserved. | ||
/* Copyright (C) 2011-2025 D. R. Commander. All Rights Reserved. | ||
* Copyright (C) 2021 Steffen Kieß | ||
* Copyright 2009-2011, 2016-2019 Pierre Ossman <[email protected]> | ||
* for Cendio AB | ||
|
@@ -1367,7 +1367,11 @@ public Rectangle getSpannedSize() { | |
// under X11 except for full-screen windows, and even then, the | ||
// appropriate WM hints must be set using C.) | ||
(Utils.isX11() && | ||
(!params.fullScreen.get() || !Helper.isAvailable()))) { | ||
(!params.fullScreen.get() || !Helper.isAvailable())) || | ||
// We're using macOS, and "Displays have separate Spaces" is enabled in | ||
// the system settings (or the state of "Displays have separate Spaces" | ||
// cannot be determined because the helper library isn't available.) | ||
(Utils.isMac() && Utils.displaysHaveSeparateSpacesHelper())) { | ||
span = primary; | ||
viewport.leftMon = viewport.rightMon = viewport.topMon = | ||
viewport.bottomMon = primaryID; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#include <jni.h> | ||
/* Header for class com_turbovnc_rfb_Utils */ | ||
|
||
#ifndef _Included_com_turbovnc_rfb_Utils | ||
#define _Included_com_turbovnc_rfb_Utils | ||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
/* | ||
* Class: com_turbovnc_rfb_Utils | ||
* Method: displaysHaveSeparateSpaces | ||
* Signature: ()Z | ||
*/ | ||
JNIEXPORT jboolean JNICALL Java_com_turbovnc_rfb_Utils_displaysHaveSeparateSpaces | ||
(JNIEnv *, jobject); | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif | ||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters