Skip to content

Commit

Permalink
VIDEO: disable multi viewport again - this isn't working properly yet
Browse files Browse the repository at this point in the history
  • Loading branch information
mgerhardy committed Jan 4, 2022
1 parent d0e0e00 commit d3d8f5e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 13 deletions.
13 changes: 0 additions & 13 deletions src/modules/ui/imgui/IMGUIApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -758,19 +758,6 @@ void IMGUIApp::beforeUI() {
// when straying out of bounds.
int windowX = 0, windowY = 0;
SDL_GetWindowPosition(mouseWindow, &windowX, &windowY);
int index = SDL_GetWindowDisplayIndex(mouseWindow);
if (index >= 0) {
SDL_Rect rect;
if (SDL_GetDisplayBounds(index, &rect) == 0) {
SDL_Point point;
point.x = mouseXGlobal;
point.y = mouseYGlobal;
if (!SDL_PointInRect(&point, &rect)) {
windowX -= rect.x;
windowY -= rect.y;
}
}
}
io.MousePos = ImVec2((float)(mouseXGlobal - windowX), (float)(mouseYGlobal - windowY));
}
} else {
Expand Down
5 changes: 5 additions & 0 deletions src/modules/video/WindowedApp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ app::AppState WindowedApp::onInit() {
if (isSingleWindowMode()) {
_mouseCanUseGlobalState = false;
} else {
#if 0
// Check and store if we are on a SDL backend that supports global mouse position
// ("wayland" and "rpi" don't support it, but we chose to use a white-list instead of a black-list)
const char *sdlBackend = SDL_GetCurrentVideoDriver();
Expand All @@ -384,6 +385,10 @@ app::AppState WindowedApp::onInit() {
_mouseCanUseGlobalState = true;
}
}
#else
// TODO: the window (0:0) the mouse is hovering is on SDL display 0 (0:0:2560:1440), but the global mouse position is at 3646:769
_mouseCanUseGlobalState = false;
#endif
}

video_trace_init();
Expand Down

0 comments on commit d3d8f5e

Please sign in to comment.