aboutsummaryrefslogtreecommitdiffstats
path: root/vncviewer
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2021-07-20 14:24:10 +0200
committerPierre Ossman <ossman@cendio.se>2021-07-20 14:24:10 +0200
commit1a008c1380305648ab50f1d99e73439747e9d61d (patch)
tree87253038fbf9d6a5b1a3252e0ec41d91f7a33c5a /vncviewer
parentb24cfff4be24b21382cc1568eee8136a8b436edc (diff)
downloadtigervnc-1a008c1380305648ab50f1d99e73439747e9d61d.tar.gz
tigervnc-1a008c1380305648ab50f1d99e73439747e9d61d.zip
Simply screen refresh handler
We only need to check the event type once, and preferably early, and avoid doing more work than necessary.
Diffstat (limited to 'vncviewer')
-rw-r--r--vncviewer/MonitorArrangement.cxx13
1 files changed, 4 insertions, 9 deletions
diff --git a/vncviewer/MonitorArrangement.cxx b/vncviewer/MonitorArrangement.cxx
index 4c8e8db6..93227c59 100644
--- a/vncviewer/MonitorArrangement.cxx
+++ b/vncviewer/MonitorArrangement.cxx
@@ -448,18 +448,13 @@ int MonitorArrangement::get_monitor_name(int m, char name[], size_t name_len)
int MonitorArrangement::fltk_event_handler(int event)
{
- MonitorArrangement *self;
std::set<MonitorArrangement *>::iterator it;
- for (it = instances.begin(); it != instances.end(); it++) {
- self = *it;
+ if (event != FL_SCREEN_CONFIGURATION_CHANGED)
+ return 0;
- switch (event) {
- case FL_SCREEN_CONFIGURATION_CHANGED:
- self->refresh();
- break;
- }
- }
+ for (it = instances.begin(); it != instances.end(); it++)
+ (*it)->refresh();
return 0;
}