Handle scrolling manually
Stop fighting with the FLTK scroll widget and handle layout ourselves.
This opens up the possibility of doing more complex drawing as well.
diff --git a/vncviewer/DesktopWindow.h b/vncviewer/DesktopWindow.h
index d755b6d..d0e2eae 100644
--- a/vncviewer/DesktopWindow.h
+++ b/vncviewer/DesktopWindow.h
@@ -32,7 +32,7 @@
class CConn;
class Viewport;
-class Fl_Scroll;
+class Fl_Scrollbar;
class DesktopWindow : public Fl_Window {
public:
@@ -58,6 +58,7 @@
void* data, void* mask);
// Fl_Window callback methods
+ void draw();
void resize(int x, int y, int w, int h);
int handle(int event);
@@ -78,7 +79,7 @@
static void handleResizeTimeout(void *data);
void remoteResize(int width, int height);
- void repositionViewport();
+ void repositionWidgets();
static void handleClose(Fl_Widget *wnd, void *data);
@@ -86,11 +87,13 @@
static void handleFullscreenTimeout(void *data);
+ void scrollTo(int x, int y);
+ static void handleScroll(Fl_Widget *wnd, void *data);
static void handleEdgeScroll(void *data);
private:
CConn* cc;
- Fl_Scroll *scroll;
+ Fl_Scrollbar *hscroll, *vscroll;
Viewport *viewport;
bool firstUpdate;