diff options
| -rw-r--r-- | FL/Fl_Window_Driver.H | 4 | ||||
| -rw-r--r-- | FL/x.H | 1 | ||||
| -rw-r--r-- | src/Fl_Window_Driver.cxx | 4 | ||||
| -rw-r--r-- | src/Fl_x.cxx | 29 | ||||
| -rw-r--r-- | src/drivers/X11/Fl_X11_Window_Driver.H | 1 | ||||
| -rw-r--r-- | src/drivers/X11/Fl_X11_Window_Driver.cxx | 4 |
6 files changed, 26 insertions, 17 deletions
diff --git a/FL/Fl_Window_Driver.H b/FL/Fl_Window_Driver.H index 62fe68637..f8f5e1bfb 100644 --- a/FL/Fl_Window_Driver.H +++ b/FL/Fl_Window_Driver.H @@ -78,11 +78,15 @@ public: int minh(); int maxw(); int maxh(); + int dw(); + int dh(); + int aspect(); int fullscreen_screen_top(); int fullscreen_screen_bottom(); int fullscreen_screen_left(); int fullscreen_screen_right(); unsigned char size_range_set(); + int force_position(); void force_position(int c); void x(int X); void y(int Y); @@ -120,7 +120,6 @@ public: char wait_for_expose; static Fl_X* first; static Fl_X* i(const Fl_Window* wi) {return wi->i;} - void sendxjunk(); int set_cursor(Fl_Cursor); int set_cursor(const Fl_RGB_Image*, int, int); static void make_xid(Fl_Window*,XVisualInfo* =fl_visual, Colormap=fl_colormap); diff --git a/src/Fl_Window_Driver.cxx b/src/Fl_Window_Driver.cxx index ac438d32a..7a0c9848d 100644 --- a/src/Fl_Window_Driver.cxx +++ b/src/Fl_Window_Driver.cxx @@ -41,6 +41,10 @@ int Fl_Window_Driver::minw() {return pWindow->minw;} int Fl_Window_Driver::minh() {return pWindow->minh;} int Fl_Window_Driver::maxw() {return pWindow->maxw;} int Fl_Window_Driver::maxh() {return pWindow->maxh;} +int Fl_Window_Driver::dw() {return pWindow->dw;} +int Fl_Window_Driver::dh() {return pWindow->dh;} +int Fl_Window_Driver::aspect() {return pWindow->aspect;} +int Fl_Window_Driver::force_position() {return pWindow->force_position(); } void Fl_Window_Driver::force_position(int c) { pWindow->force_position(c); } void Fl_Window_Driver::x(int X) {pWindow->x(X); } void Fl_Window_Driver::y(int Y) {pWindow->y(Y); } diff --git a/src/Fl_x.cxx b/src/Fl_x.cxx index 41aeb2c87..c564f0d93 100644 --- a/src/Fl_x.cxx +++ b/src/Fl_x.cxx @@ -2221,7 +2221,7 @@ Fl_X* Fl_X::set_xid(Fl_Window* win, Window winxid) { xp->region = 0; xp->wait_for_expose = 1; #ifdef USE_XDBE - ((Fl_X11_Window_Driver*)win->driver())->backbuffer_bad = 1; + ((Fl_X11_Window_Driver*)win->pWindowDriver)->backbuffer_bad = 1; #endif Fl_X::first = xp; if (win->modal()) {Fl::modal_ = win; fl_fix_focus();} @@ -2385,7 +2385,7 @@ void Fl_X::make_xid(Fl_Window* win, XVisualInfo *visual, Colormap colormap) XA_ATOM, 32, 0, (uchar*)&WM_DELETE_WINDOW, 1); // send size limits and border: - xp->sendxjunk(); + ((Fl_X11_Window_Driver*)win->pWindowDriver)->sendxjunk(); // set the class property, which controls the icon used: if (win->xclass()) { @@ -2501,10 +2501,11 @@ void Fl_X::make_xid(Fl_Window* win, XVisualInfo *visual, Colormap colormap) //////////////////////////////////////////////////////////////// // Send X window stuff that can be changed over time: -void Fl_X::sendxjunk() { +void Fl_X11_Window_Driver::sendxjunk() { + Fl_Window *w = pWindow; if (w->parent() || w->override()) return; // it's not a window manager window! - if (!w->size_range_set) { // default size_range based on resizable(): + if (!size_range_set()) { // default size_range based on resizable(): if (w->resizable()) { Fl_Widget *o = w->resizable(); int minw = o->w(); if (minw > 100) minw = 100; @@ -2518,12 +2519,12 @@ void Fl_X::sendxjunk() { XSizeHints *hints = XAllocSizeHints(); // memset(&hints, 0, sizeof(hints)); jreiser suggestion to fix purify? - hints->min_width = w->minw; - hints->min_height = w->minh; - hints->max_width = w->maxw; - hints->max_height = w->maxh; - hints->width_inc = w->dw; - hints->height_inc = w->dh; + hints->min_width = minw(); + hints->min_height = minh(); + hints->max_width = maxw(); + hints->max_height = maxh(); + hints->width_inc = dw(); + hints->height_inc = dh(); hints->win_gravity = StaticGravity; // see the file /usr/include/X11/Xm/MwmUtil.h: @@ -2544,7 +2545,7 @@ void Fl_X::sendxjunk() { if (hints->max_height < hints->min_height) hints->max_height = Fl::h(); } if (hints->width_inc && hints->height_inc) hints->flags |= PResizeInc; - if (w->aspect) { + if (aspect()) { // stupid X! It could insist that the corner go on the // straight line between min and max... hints->min_aspect.x = hints->max_aspect.x = hints->min_width; @@ -2557,7 +2558,7 @@ void Fl_X::sendxjunk() { prop[1] = 1|2|16; // MWM_FUNC_ALL | MWM_FUNC_RESIZE | MWM_FUNC_MAXIMIZE } - if (w->force_position()) { + if (force_position()) { hints->flags |= USPosition; hints->x = w->x(); hints->y = w->y(); @@ -2568,8 +2569,8 @@ void Fl_X::sendxjunk() { prop[2] = 0; // no decorations } - XSetWMNormalHints(fl_display, xid, hints); - XChangeProperty(fl_display, xid, + XSetWMNormalHints(fl_display, fl_xid(w), hints); + XChangeProperty(fl_display, fl_xid(w), fl_MOTIF_WM_HINTS, fl_MOTIF_WM_HINTS, 32, 0, (unsigned char *)prop, 5); XFree(hints); diff --git a/src/drivers/X11/Fl_X11_Window_Driver.H b/src/drivers/X11/Fl_X11_Window_Driver.H index e255e8c94..fd2828d2e 100644 --- a/src/drivers/X11/Fl_X11_Window_Driver.H +++ b/src/drivers/X11/Fl_X11_Window_Driver.H @@ -68,6 +68,7 @@ private: void shape_bitmap_(Fl_Image* b); void shape_alpha_(Fl_Image* img, int offset); void flush_double(int erase_overlay); + void sendxjunk(); #ifdef USE_XDBE char backbuffer_bad; void flush_double_dbe(int erase_overlay); diff --git a/src/drivers/X11/Fl_X11_Window_Driver.cxx b/src/drivers/X11/Fl_X11_Window_Driver.cxx index b5f056a24..7dbb5c4f7 100644 --- a/src/drivers/X11/Fl_X11_Window_Driver.cxx +++ b/src/drivers/X11/Fl_X11_Window_Driver.cxx @@ -500,12 +500,12 @@ void Fl_X11_Window_Driver::unmap() { // the window full screen will lose the size of the border off the // bottom and right. void Fl_X11_Window_Driver::use_border() { - if (shown()) Fl_X::i(pWindow)->sendxjunk(); + if (shown()) sendxjunk(); } void Fl_X11_Window_Driver::size_range() { Fl_Window_Driver::size_range(); - if (shown()) Fl_X::i(pWindow)->sendxjunk(); + if (shown()) sendxjunk(); } void Fl_X11_Window_Driver::iconize() { |
