Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core_patches.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void CorePatches::hideMousePointer() {
}

void CorePatches::setFullscreen(void* t, bool fullscreen) {
currentGameWindowCallbacks->setFullscreen(fullscreen);
currentGameWindowCallbacks->setFullscreen(fullscreen, true);
}

void CorePatches::setGameWindow(std::shared_ptr<GameWindow> gameWindow) {
Expand Down
11 changes: 8 additions & 3 deletions src/window_callbacks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,14 @@ void WindowCallbacks::onClose() {
jniSupport.onWindowClosed();
}

void WindowCallbacks::setFullscreen(bool isFs) {
if(fullscreen != isFs) {
void WindowCallbacks::setFullscreen(bool isFs, bool calledFromSymbol) {
if(fullscreen != isFs && !(calledFromSymbol && useLegacyFullscreen && hasUsedLegacyFullscreen)) {
window.setFullscreen(isFs);
fullscreen = isFs;
}
if (calledFromSymbol) {
useLegacyFullscreen = false;
}
}

bool WindowCallbacks::hasInputMode(WindowCallbacks::InputMode want, bool changeMode) {
Expand Down Expand Up @@ -156,8 +159,10 @@ void WindowCallbacks::onKeyboard(KeyCode key, KeyAction action) {
jniSupport.getTextInputHandler().onKeyPressed(key, action);
}

if(key == KeyCode::FN11 && action == KeyAction::PRESS)
if(key == KeyCode::FN11 && action == KeyAction::PRESS && useLegacyFullscreen) {
hasUsedLegacyFullscreen = true;
setFullscreen(!fullscreen);
}

if(useDirectKeyboardInput && (action == KeyAction::PRESS || action == KeyAction::RELEASE)) {
if (Keyboard::useLegacyKeyboard) {
Expand Down
4 changes: 3 additions & 1 deletion src/window_callbacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ class WindowCallbacks {
bool modCTRL = false;
bool needsQueueGamepadInput = true;
bool fullscreen = options.fullscreen;
bool useLegacyFullscreen = true;
bool hasUsedLegacyFullscreen = false;
bool sendEvents = false;
enum class InputMode {
Touch,
Expand Down Expand Up @@ -52,7 +54,7 @@ class WindowCallbacks {

void onClose();

void setFullscreen(bool isFs);
void setFullscreen(bool isFs, bool calledFromSymbol = false);

void onMouseButton(double x, double y, int btn, MouseButtonAction action);
void onMousePosition(double x, double y);
Expand Down