mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-19 04:26:52 -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;
|
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) {
|
void Window_SetVisible(bool visible) {
|
||||||
if (visible == win_visible) return;
|
|
||||||
if (visible) {
|
if (visible) {
|
||||||
XMapWindow(win_display, win_handle);
|
XMapWindow(win_display, win_handle);
|
||||||
} else {
|
} else {
|
||||||
@ -2145,8 +2148,6 @@ void Window_SetClipboardText(const String* value) {
|
|||||||
|
|
||||||
bool Window_GetVisible(void) { return IsWindowVisible(win_handle); }
|
bool Window_GetVisible(void) { return IsWindowVisible(win_handle); }
|
||||||
void Window_SetVisible(bool visible) {
|
void Window_SetVisible(bool visible) {
|
||||||
if (visible == Window_GetVisible()) return;
|
|
||||||
|
|
||||||
if (visible) {
|
if (visible) {
|
||||||
ShowWindow(win_handle);
|
ShowWindow(win_handle);
|
||||||
RepositionWindow(win_handle, NULL, kWindowCenterOnMainScreen);
|
RepositionWindow(win_handle, NULL, kWindowCenterOnMainScreen);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user