Skip to content

Commit 24a8909

Browse files
committed
Size edge scroll after window, not remote session
This should scale with the rest of the visible interface, not the invisible stuff that might vary wildely. In the most extreme cases, there is no usable area left as everything on screen becomes "edge".
1 parent f06e574 commit 24a8909

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

vncviewer/DesktopWindow.cxx

+5-5
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
#endif
5959

6060
// width of each "edge" region where scrolling happens,
61-
// as a ratio compared to the viewport size
62-
// default: 1/16th of the viewport size
61+
// as a ratio compared to the window size
62+
// default: 1/16th of the window size
6363
#define EDGE_SCROLL_SIZE 16
6464
// edge width is calculated at runtime; these values are just examples
6565
static int edge_scroll_size_x = 128;
@@ -863,9 +863,9 @@ int DesktopWindow::handle(int event)
863863
}
864864
if (fullscreen_active()) {
865865
// calculate width of "edge" regions
866-
edge_scroll_size_x = viewport->w() / EDGE_SCROLL_SIZE;
867-
edge_scroll_size_y = viewport->h() / EDGE_SCROLL_SIZE;
868-
// if cursor is near the edge of the viewport, scroll
866+
edge_scroll_size_x = w() / EDGE_SCROLL_SIZE;
867+
edge_scroll_size_y = h() / EDGE_SCROLL_SIZE;
868+
// if cursor is near the edge of the window, scroll
869869
if (((viewport->x() < 0) && (Fl::event_x() < edge_scroll_size_x)) ||
870870
((viewport->x() + viewport->w() >= w()) && (Fl::event_x() >= w() - edge_scroll_size_x)) ||
871871
((viewport->y() < 0) && (Fl::event_y() < edge_scroll_size_y)) ||

0 commit comments

Comments
 (0)