summaryrefslogtreecommitdiff
path: root/src/drivers/Wayland
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-05-27 11:34:34 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-05-27 11:39:27 +0200
commitf3f69b892d0755d3674502e1de8cd7c4abb43755 (patch)
treebf393458e8cbd93aaccf80399575234e040309b1 /src/drivers/Wayland
parentc1333a2dec3616dbd6a53089885b48aee1d11a8d (diff)
Remove useless Fl_Window_Driver accessors after new member Fl_Window::get_size_range()
Diffstat (limited to 'src/drivers/Wayland')
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx6
-rw-r--r--src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx16
2 files changed, 10 insertions, 12 deletions
diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
index 4d2dd1d24..647a1b461 100644
--- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx
@@ -1873,11 +1873,7 @@ void *Fl_Wayland_Screen_Driver::control_maximize_button(void *data) {
LIBDECOR_WINDOW_STATE_MAXIMIZED) ) {
win_dims *dim = new win_dims;
dim->tracker = new Fl_Widget_Tracker(win);
- Fl_Window_Driver *dr = Fl_Window_Driver::driver(win);
- dim->minw = dr->minw();
- dim->minh = dr->minh();
- dim->maxw = dr->maxw();
- dim->maxh = dr->maxh();
+ win->get_size_range(&dim->minw, &dim->minh, &dim->maxw, &dim->maxh, NULL, NULL, NULL);
//make win un-resizable
win->size_range(win->w(), win->h(), win->w(), win->h());
dim->next = first_dim;
diff --git a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
index 76b7da691..fbe5dc9ab 100644
--- a/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
+++ b/src/drivers/Wayland/Fl_Wayland_Window_Driver.cxx
@@ -542,30 +542,32 @@ void Fl_Wayland_Window_Driver::size_range() {
Fl_X* ip = Fl_X::flx(pWindow);
struct wld_window *wl_win = (struct wld_window*)ip->xid;
float f = Fl::screen_scale(pWindow->screen_num());
+ int minw, minh, maxw, maxh;
+ pWindow->get_size_range(&minw, &minh, &maxw, &maxh, NULL, NULL, NULL);
if (wl_win->kind == DECORATED && wl_win->frame) {
int X,Y,W,H;
Fl::screen_work_area(X,Y,W,H, Fl::screen_num(x(),y(),w(),h()));
- if (maxw() && maxw() < W && maxh() && maxh() < H) {
+ if (maxw && maxw < W && maxh && maxh < H) {
libdecor_frame_unset_capabilities(wl_win->frame, LIBDECOR_ACTION_FULLSCREEN);
} else {
libdecor_frame_set_capabilities(wl_win->frame, LIBDECOR_ACTION_FULLSCREEN);
}
- if (maxw() && maxh() && (minw() >= maxw() || minh() >= maxh())) {
+ if (maxw && maxh && (minw >= maxw || minh >= maxh)) {
libdecor_frame_unset_capabilities(wl_win->frame, LIBDECOR_ACTION_RESIZE);
} else {
libdecor_frame_set_capabilities(wl_win->frame, LIBDECOR_ACTION_RESIZE);
}
- libdecor_frame_set_min_content_size(wl_win->frame, minw()*f, minh()*f);
- libdecor_frame_set_max_content_size(wl_win->frame, maxw()*f, maxh()*f);
+ libdecor_frame_set_min_content_size(wl_win->frame, minw*f, minh*f);
+ libdecor_frame_set_max_content_size(wl_win->frame, maxw*f, maxh*f);
if (xdg_toplevel()) {
struct libdecor_state *state = libdecor_state_new(int(w() * f), int(h() * f));
libdecor_frame_commit(wl_win->frame, state, NULL);
libdecor_state_free(state);
}
} else if (wl_win->kind == UNFRAMED && wl_win->xdg_toplevel) {
- xdg_toplevel_set_min_size(wl_win->xdg_toplevel, minw()*f, minh()*f);
- if (maxw() && maxh())
- xdg_toplevel_set_max_size(wl_win->xdg_toplevel, maxw()*f, maxh()*f);
+ xdg_toplevel_set_min_size(wl_win->xdg_toplevel, minw*f, minh*f);
+ if (maxw && maxh)
+ xdg_toplevel_set_max_size(wl_win->xdg_toplevel, maxw*f, maxh*f);
}
}
}