mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-18 03:55:19 -04:00
fix Window_GetVisible sometimes being wrong on linux
This commit is contained in:
parent
17b838eba1
commit
d7ecbd99fd
@ -968,10 +968,13 @@ void Window_SetClipboardText(const String* value) {
|
||||
}
|
||||
|
||||
static bool win_visible;
|
||||
bool Window_GetVisible(void) { return win_visible; }
|
||||
bool Window_GetVisible(void) {
|
||||
XWindowAttributes attr;
|
||||
XGetWindowAttributes(win_display, win_handle, &attr);
|
||||
return attr.map_state == IsViewable;
|
||||
}
|
||||
|
||||
void Window_SetVisible(bool visible) {
|
||||
if (visible == win_visible) return;
|
||||
if (visible) {
|
||||
XMapWindow(win_display, win_handle);
|
||||
} else {
|
||||
@ -2145,8 +2148,6 @@ void Window_SetClipboardText(const String* value) {
|
||||
|
||||
bool Window_GetVisible(void) { return IsWindowVisible(win_handle); }
|
||||
void Window_SetVisible(bool visible) {
|
||||
if (visible == Window_GetVisible()) return;
|
||||
|
||||
if (visible) {
|
||||
ShowWindow(win_handle);
|
||||
RepositionWindow(win_handle, NULL, kWindowCenterOnMainScreen);
|
||||
|
Loading…
x
Reference in New Issue
Block a user