main_window->fullscreen = FALSE;
}
+ WindowShowSidebar(win, enableFullscreen ? false : win->sidebarvisible);
+
XEvent ev;
memset(&ev, 0, sizeof(XEvent));
ev.type = ClientMessage;
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) {
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) {