summaryrefslogtreecommitdiff
path: root/src/drivers
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-03-11 08:31:36 +0000
committerManolo Gouy <Manolo>2016-03-11 08:31:36 +0000
commit408d0672a4b50dc7f9d8babd6d03f5cdcbe034da (patch)
treec846deb289be7eed30d72bb06a8fc958bbb55130 /src/drivers
parent2952c530b856c5cca973fef34edc5d738fb8c0f7 (diff)
Rewrite Fl_Window::wait_for_expose() using the window driver approach.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11346 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/drivers')
-rw-r--r--src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H2
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H1
-rw-r--r--src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx9
-rw-r--r--src/drivers/X11/Fl_X11_Window_Driver.H1
-rw-r--r--src/drivers/X11/Fl_X11_Window_Driver.cxx8
5 files changed, 21 insertions, 0 deletions
diff --git a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H
index 36be7ee7d..86cf1c8d1 100644
--- a/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H
+++ b/src/drivers/Cocoa/Fl_Cocoa_Window_Driver.H
@@ -65,6 +65,8 @@ public:
virtual void draw();
// that one is implemented in Fl_Cocoa.mm because it uses Objective-c
virtual void capture_titlebar_and_borders(Fl_Shared_Image*& top, Fl_Shared_Image*& left, Fl_Shared_Image*& bottom, Fl_Shared_Image*& right);
+ //this one is in Fl_cocoa.mm because it uses Objective-c
+ virtual void wait_for_expose();
};
diff --git a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H
index 53c00cad4..7000356e3 100644
--- a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H
+++ b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.H
@@ -75,6 +75,7 @@ public:
void icons(HICON big_icon, HICON small_icon);
// this one is implemented in Fl_win32.cxx
virtual void capture_titlebar_and_borders(Fl_Shared_Image*& top, Fl_Shared_Image*& left, Fl_Shared_Image*& bottom, Fl_Shared_Image*& right);
+ virtual void wait_for_expose();
};
diff --git a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
index 796f60c36..f1b086566 100644
--- a/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
+++ b/src/drivers/WinAPI/Fl_WinAPI_Window_Driver.cxx
@@ -18,6 +18,7 @@
#include "../../config_lib.h"
+#include <FL/Fl.H>
#include "Fl_WinAPI_Window_Driver.H"
#include <windows.h>
@@ -247,6 +248,14 @@ void Fl_WinAPI_Window_Driver::icons(HICON big_icon, HICON small_icon)
Fl_X::i(pWindow)->set_icons();
}
+void Fl_WinAPI_Window_Driver::wait_for_expose() {
+ if (!pWindow->shown()) return;
+ Fl_X *i = Fl_X::i(pWindow);
+ while (!i || i->wait_for_expose) {
+ Fl::wait();
+ }
+}
+
//
// End of "$Id$".
//
diff --git a/src/drivers/X11/Fl_X11_Window_Driver.H b/src/drivers/X11/Fl_X11_Window_Driver.H
index 1eb161e0b..2d42b4410 100644
--- a/src/drivers/X11/Fl_X11_Window_Driver.H
+++ b/src/drivers/X11/Fl_X11_Window_Driver.H
@@ -74,6 +74,7 @@ public:
virtual void icon(const void * ic);
virtual void free_icons();
virtual void capture_titlebar_and_borders(Fl_Shared_Image*& top, Fl_Shared_Image*& left, Fl_Shared_Image*& bottom, Fl_Shared_Image*& right);
+ virtual void wait_for_expose();
};
diff --git a/src/drivers/X11/Fl_X11_Window_Driver.cxx b/src/drivers/X11/Fl_X11_Window_Driver.cxx
index 32ac787a2..05c27a972 100644
--- a/src/drivers/X11/Fl_X11_Window_Driver.cxx
+++ b/src/drivers/X11/Fl_X11_Window_Driver.cxx
@@ -331,6 +331,14 @@ void Fl_X11_Window_Driver::capture_titlebar_and_borders(Fl_Shared_Image*& top, F
previous->Fl_Surface_Device::set_current();
}
+void Fl_X11_Window_Driver::wait_for_expose() {
+ if (!pWindow->shown()) return;
+ Fl_X *i = Fl_X::i(pWindow);
+ while (!i || i->wait_for_expose) {
+ Fl::wait();
+ }
+}
+
//
// End of "$Id$".
//