mirror of
https://github.com/fltk/fltk.git
synced 2026-05-31 13:55:38 +08:00
Wayland: restore support of Fl_Tile with subwindow widget - cont'd
This commit is contained in:
@@ -25,9 +25,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
class FL_EXPORT Fl_Tile : public Fl_Group {
|
class FL_EXPORT Fl_Tile : public Fl_Group {
|
||||||
friend class Fl_Window_Driver;
|
|
||||||
private:
|
|
||||||
static bool in_drag_intersection_;
|
|
||||||
public:
|
public:
|
||||||
int handle(int event) FL_OVERRIDE;
|
int handle(int event) FL_OVERRIDE;
|
||||||
Fl_Tile(int X, int Y, int W, int H, const char *L=0);
|
Fl_Tile(int X, int Y, int W, int H, const char *L=0);
|
||||||
|
|||||||
@@ -482,7 +482,6 @@ void Fl_Tile::move_intersection(int oldx, int oldy, int newx, int newy) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Fl_Tile::in_drag_intersection_ = false;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Drags the intersection at (\p oldx,\p oldy) to (\p newx,\p newy).
|
Drags the intersection at (\p oldx,\p oldy) to (\p newx,\p newy).
|
||||||
@@ -534,12 +533,10 @@ void Fl_Tile::drag_intersection(int oldx, int oldy, int newx, int newy) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
// resize all children that have changed in size
|
// resize all children that have changed in size
|
||||||
in_drag_intersection_ = true;
|
|
||||||
for (i = 0; i < children(); i++) {
|
for (i = 0; i < children(); i++) {
|
||||||
Fl_Rect &r = final_size[i];
|
Fl_Rect &r = final_size[i];
|
||||||
child(i)->damage_resize(r.x(), r.y(), r.w(), r.h());
|
child(i)->damage_resize(r.x(), r.y(), r.w(), r.h());
|
||||||
}
|
}
|
||||||
in_drag_intersection_ = false;
|
|
||||||
delete[] final_size;
|
delete[] final_size;
|
||||||
} else {
|
} else {
|
||||||
move_intersection(oldx, oldy, newx, newy);
|
move_intersection(oldx, oldy, newx, newy);
|
||||||
|
|||||||
@@ -209,7 +209,6 @@ public:
|
|||||||
|
|
||||||
virtual fl_uintptr_t os_id() { return 0; }
|
virtual fl_uintptr_t os_id() { return 0; }
|
||||||
virtual void allow_expand_outside_parent() {}
|
virtual void allow_expand_outside_parent() {}
|
||||||
static bool in_tile_intersection_drag() { return Fl_Tile::in_drag_intersection_; }
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // FL_WINDOW_DRIVER_H
|
#endif // FL_WINDOW_DRIVER_H
|
||||||
|
|||||||
@@ -1822,7 +1822,8 @@ void Fl_Wayland_Window_Driver::resize(int X, int Y, int W, int H) {
|
|||||||
if (shown() && !(parent() || popup_window())) {
|
if (shown() && !(parent() || popup_window())) {
|
||||||
X = Y = 0;
|
X = Y = 0;
|
||||||
}
|
}
|
||||||
struct wld_window *parent_xid = parent() ? fl_wl_xid(pWindow->window()) : NULL;
|
Fl_Window *parent = this->parent() ? pWindow->window() : NULL;
|
||||||
|
struct wld_window *parent_xid = parent ? fl_wl_xid(parent) : NULL;
|
||||||
xid_and_rect *xid_rect = NULL;
|
xid_and_rect *xid_rect = NULL;
|
||||||
if (parent_xid && parent_xid->frame_cb && wl_proxy_get_listener((struct wl_proxy*)parent_xid->frame_cb) == &surface_frame_listener) {
|
if (parent_xid && parent_xid->frame_cb && wl_proxy_get_listener((struct wl_proxy*)parent_xid->frame_cb) == &surface_frame_listener) {
|
||||||
xid_rect = (xid_and_rect*)wl_callback_get_user_data(parent_xid->frame_cb);
|
xid_rect = (xid_and_rect*)wl_callback_get_user_data(parent_xid->frame_cb);
|
||||||
@@ -1831,7 +1832,8 @@ void Fl_Wayland_Window_Driver::resize(int X, int Y, int W, int H) {
|
|||||||
// When moving or resizing a non-GL subwindow independently from its parent, this condition
|
// When moving or resizing a non-GL subwindow independently from its parent, this condition
|
||||||
// delays application of X,Y,W,H values until the compositor signals
|
// delays application of X,Y,W,H values until the compositor signals
|
||||||
// it's ready for a new frame using the frame callback mechanism.
|
// it's ready for a new frame using the frame callback mechanism.
|
||||||
if (in_tile_intersection_drag() || depth > 1 || pWindow->as_gl_window() || !parent_xid || wait_for_expose_value || (parent_xid->frame_cb && !xid_rect)) {
|
if ((parent && parent->damage()) || depth > 1 || pWindow->as_gl_window() || !parent_xid ||
|
||||||
|
wait_for_expose_value || (parent_xid->frame_cb && !xid_rect)) {
|
||||||
if (is_a_resize) {
|
if (is_a_resize) {
|
||||||
if (pWindow->parent()) {
|
if (pWindow->parent()) {
|
||||||
if (W < 1) W = 1;
|
if (W < 1) W = 1;
|
||||||
@@ -1909,7 +1911,7 @@ void Fl_Wayland_Window_Driver::resize(int X, int Y, int W, int H) {
|
|||||||
}
|
}
|
||||||
Fl_Wayland_Graphics_Driver::buffer_commit(parent_xid);
|
Fl_Wayland_Graphics_Driver::buffer_commit(parent_xid);
|
||||||
} else {
|
} else {
|
||||||
if (!in_tile_intersection_drag() && !parent_xid->frame_cb) {
|
if (!(parent && parent->damage()) && !parent_xid->frame_cb) {
|
||||||
// use the frame callback mechanism and memorize current X,Y,W,H values
|
// use the frame callback mechanism and memorize current X,Y,W,H values
|
||||||
xid_rect = new xid_and_rect;
|
xid_rect = new xid_and_rect;
|
||||||
xid_rect->xid = parent_xid;
|
xid_rect->xid = parent_xid;
|
||||||
|
|||||||
Reference in New Issue
Block a user