void Panel::update_size_and_pos(bool create_xid, bool update_strut) { int X, Y, W, H; /* figure out screen dimensions */ if(!netwm_workarea_get_size(X, Y, W, H)) Fl::screen_xywh(X, Y, W, H); update_size_and_pos(create_xid, update_strut, X, Y, W, H); }
void Desktop::update_workarea(void) { int X, Y, W, H; if(!netwm_workarea_get_size(X, Y, W, H)) Fl::screen_xywh(X, Y, W, H); E_DEBUG(E_STRLOC ": resizing to %i %i %i %i\n", X, Y, W, H); resize(X, Y, W, H); /* also resize wallpaper if given */ if(wallpaper && wallpaper->visible()) wallpaper->resize(0, 0, w(), h()); }
void Panel::show(void) { if(shown()) { Fl_Window::show(); return; } int X, Y, W, H; fl_open_display(); /* * hush known FLTK bug with XGetImage; a lot of errors will be print when menu icons goes * outside screen; this also make ede-panel, at some point, unresponsible */ XSetErrorHandler((XErrorHandler) xerror_handler); /* position it */ if(!netwm_workarea_get_size(X, Y, W, H)) Fl::screen_xywh(X, Y, W, H); screen_x = X; screen_y = Y; screen_w = W; screen_h = H; screen_h_half = screen_h / 2; /* calculate panel percentage width if given */ if(width_perc < 100) { W = (width_perc * screen_w) / 100; X = (screen_w / 2) - (W / 2); } /* set size as soon as possible, since do_layout() depends on it */ size(W, DEFAULT_PANEL_H); do_layout(); window_xid_create(this, make_me_dock); /* position it, this is done after XID was created */ if(vpos == PANEL_POSITION_BOTTOM) { position(X, screen_h - h()); if(width_perc >= 100) netwm_window_set_strut(fl_xid(this), 0, 0, 0, h()); } else { /* FIXME: this does not work well with edewm (nor pekwm). kwin do it correctly. */ position(X, Y); if(width_perc >= 100) netwm_window_set_strut(fl_xid(this), 0, 0, h(), 0); } }