void Window::show(void) { image(Fl::scheme_bg_); if(Fl::scheme_bg_) { labeltype(FL_NORMAL_LABEL); align(FL_ALIGN_CENTER | FL_ALIGN_INSIDE | FL_ALIGN_CLIP); } else { labeltype(FL_NO_LABEL); } Fl_Tooltip::exit(this); if(!shown()) { // Don't set background pixel for double-buffered windows... int background_pixel = -1; if(type() == FL_WINDOW && ((box() == 1) || ((box() & 2) && (box() <= 15)))) { background_pixel = int(fl_xpixel(color())); } window_xid_create(this, set_titlebar_icon, background_pixel); } else { XMapRaised(fl_display, fl_xid(this)); } }
void Desktop::show(void) { if(shown()) { EDE_DESKTOP_WINDOW::show(); return; } window_xid_create(this, make_me_desktop); netwm_callback_add(desktop_message_handler, this); }
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); } }
void Panel::update_size_and_pos(bool create_xid, bool update_strut, int X, int Y, int W, int H) { /* do not update ourself if we screen sizes are the same */ if(screen_x == X && screen_y == Y && screen_w == W && screen_h == H) return; 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(); if(create_xid) 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 && update_strut) set_strut(PANEL_STRUT_REMOVE | PANEL_STRUT_BOTTOM); } else { /* FIXME: this does not work well with edewm (nor pekwm). kwin do it correctly. */ position(X, Y); if(width_perc >= 100 && update_strut) set_strut(PANEL_STRUT_REMOVE | PANEL_STRUT_TOP); } }