Replace Fl_X::sendxjunk() under USE_X11 by Fl_X11_Window_Driver::sendxjunk().

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11650 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Manolo Gouy 2016-04-18 13:17:09 +00:00
parent cb95d40067
commit 9df9ffdc4c
6 changed files with 26 additions and 17 deletions

View File

@ -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);

1
FL/x.H
View File

@ -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);

View File

@ -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); }

View File

@ -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);

View File

@ -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);

View File

@ -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() {