diff options
Diffstat (limited to 'vncviewer/DesktopWindow.h')
-rw-r--r-- | vncviewer/DesktopWindow.h | 57 |
1 files changed, 34 insertions, 23 deletions
diff --git a/vncviewer/DesktopWindow.h b/vncviewer/DesktopWindow.h index ce7960ce..ca4cf53a 100644 --- a/vncviewer/DesktopWindow.h +++ b/vncviewer/DesktopWindow.h @@ -1,5 +1,5 @@ /* Copyright (C) 2002-2005 RealVNC Ltd. All Rights Reserved. - * Copyright 2011 Pierre Ossman <ossman@cendio.se> for Cendio AB + * Copyright 2011-2025 Pierre Ossman <ossman@cendio.se> for Cendio AB * * This is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,12 +20,12 @@ #ifndef __DESKTOPWINDOW_H__ #define __DESKTOPWINDOW_H__ +#include <list> #include <map> +#include <string> #include <sys/time.h> -#include <rfb/Rect.h> - #include <FL/Fl_Window.H> namespace rfb { class ModifiablePixelBuffer; } @@ -39,8 +39,7 @@ class Fl_Scrollbar; class DesktopWindow : public Fl_Window { public: - DesktopWindow(int w, int h, const char *name, - const rfb::PixelFormat& serverPF, CConn* cc_); + DesktopWindow(int w, int h, CConn* cc_); ~DesktopWindow(); // Most efficient format (from DesktopWindow's point of view) @@ -50,17 +49,19 @@ public: void updateWindow(); // Updated session title - void setName(const char *name); + void updateCaption(); // Resize the current framebuffer, but retain the contents void resizeFramebuffer(int new_w, int new_h); + // A previous call to writeSetDesktopSize() has completed + void setDesktopSizeDone(unsigned result); + // New image for the locally rendered cursor - void setCursor(int width, int height, const rfb::Point& hotspot, - const uint8_t* data); + void setCursor(); // Server-provided cursor position - void setCursorPos(const rfb::Point& pos); + void setCursorPos(const core::Point& pos); // Change client LED state void setLEDState(unsigned int state); @@ -79,11 +80,16 @@ public: void fullscreen_on(); -private: - static void menuOverlay(void *data); + // Grab keyboard events from desktop environment + void grabKeyboard(); + void ungrabKeyboard(); - void setOverlay(const char *text, ...) +private: + void addOverlayTip(const char *text, ...) __attribute__((__format__ (__printf__, 2, 3))); + void addOverlayError(const char *text, ...) + __attribute__((__format__ (__printf__, 2, 3))); + void addOverlay(const char *text); static void updateOverlay(void *data); static int fltkDispatch(int event, Fl_Window *win); @@ -91,20 +97,14 @@ private: bool hasFocus(); - void maybeGrabKeyboard(); - void grabKeyboard(); - void ungrabKeyboard(); void grabPointer(); void ungrabPointer(); - static void handleGrab(void *data); - void maximizeWindow(); - void handleDesktopSize(); static void handleResizeTimeout(void *data); static void reconfigureFullscreen(void *data); - void remoteResize(int width, int height); + void remoteResize(); void repositionWidgets(); @@ -125,17 +125,28 @@ private: Fl_Scrollbar *hscroll, *vscroll; Viewport *viewport; Surface *offscreen; - Surface *overlay; - unsigned char overlayAlpha; - struct timeval overlayStart; + + struct Overlay { + Surface *surface; + unsigned char alpha; + struct timeval start; + }; + + std::list<Overlay> overlays; + std::map<std::string, time_t> overlayTimes; bool firstUpdate; bool delayedFullscreen; - bool delayedDesktopSize; + bool sentDesktopSize; + + bool pendingRemoteResize; + struct timeval lastResize; bool keyboardGrabbed; bool mouseGrabbed; + bool regrabOnFocus; + struct statsEntry { unsigned ups; unsigned pps; |