]> uap-core.de Git - uwplayer.git/commitdiff
hide sidebar in fullscreen mode
authorOlaf Wintermann <olaf.wintermann@gmail.com>
Sun, 4 Sep 2022 17:43:56 +0000 (19:43 +0200)
committerOlaf Wintermann <olaf.wintermann@gmail.com>
Sun, 4 Sep 2022 17:43:56 +0000 (19:43 +0200)
application/window.c
application/window.h

index 2ce5c34fdd0e385e9a083c67a33f0abb9172a377..4cdeadc18ad9fe13e85fbc1a4b22f9f6406d03c2 100644 (file)
@@ -539,6 +539,8 @@ void WindowFullscreen(MainWindow *win, bool enableFullscreen) {
         main_window->fullscreen = FALSE;
     }
     
+    WindowShowSidebar(win, enableFullscreen ? false : win->sidebarvisible);
+    
     XEvent ev;
     memset(&ev, 0, sizeof(XEvent));
     ev.type = ClientMessage;
@@ -655,11 +657,8 @@ static void ViewFullscreenCB(Widget w, void *udata, void *cdata) {
 static void ViewSidebarCB(Widget w, void *udata, void *cdata) {
     MainWindow *win = udata;
     XmToggleButtonCallbackStruct *cb = cdata;
-    if(cb->set) {
-        WindowShowSidebar(win);
-    } else {
-        WindowHideSidebar(win);
-    }
+    win->sidebarvisible = cb->set;
+    WindowShowSidebar(win, cb->set);
 }
 
 static void ViewAdjustWindowSizeCB(Widget w, void *udata, void *cdata) {
@@ -720,14 +719,14 @@ void WindowShowPlayerCursor(MainWindow *win) {
     win->cursorhidden = False;
 }
 
-void WindowHideSidebar(MainWindow *win) {
-    XtUnmanageChild(win->sidebar);
-    XtVaSetValues(win->player_widget, XmNrightAttachment, XmATTACH_FORM, NULL);
-}
-
-void WindowShowSidebar(MainWindow *win) {
-    XtManageChild(win->sidebar);
-    XtVaSetValues(win->player_widget, XmNrightAttachment, XmATTACH_WIDGET, XmNrightWidget, win->sidebar, NULL);
+void WindowShowSidebar(MainWindow *win, bool visible) {
+    if(visible) {
+        XtManageChild(win->sidebar);
+        XtVaSetValues(win->player_widget, XmNrightAttachment, XmATTACH_WIDGET, XmNrightWidget, win->sidebar, NULL);
+    } else {
+        XtUnmanageChild(win->sidebar);
+        XtVaSetValues(win->player_widget, XmNrightAttachment, XmATTACH_FORM, NULL);
+    }
 }
 
 void WindowUpdate(MainWindow *win) {
index 55bdd1f741650368086904a9ee6253079b09052b..dd44b8893a7e05d06c93b05bcd892f660708e678 100644 (file)
@@ -111,8 +111,7 @@ void WindowShowPlayerCursor(MainWindow *win);
 
 void WindowHandlePlayerEvent(MainWindow *win, XEvent *event);
 
-void WindowHideSidebar(MainWindow *win);
-void WindowShowSidebar(MainWindow *win);
+void WindowShowSidebar(MainWindow *win, bool visible);
 
 void WindowUpdate(MainWindow *win);