]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/xscreen.C
Change glob() API to accept a dir parameter.
[lyx.git] / src / frontends / xforms / xscreen.C
index 7521699b0dd7bc3c2a401f23670cf6dd0fde5399..826dae7635b5902a2960745b87e823fbe8519d9c 100644 (file)
 #include "XWorkArea.h"
 
 #include "debug.h"
+#include "LColor.h"
 
 using std::endl;
-using std::max;
-using std::min;
 
+namespace lyx {
+namespace frontend {
 
 namespace {
 
@@ -80,7 +81,7 @@ void XScreen::setCursorColor()
 
 void XScreen::showCursor(int x, int y, int h, Cursor_Shape shape)
 {
-       // Update the cursor color. (a little slow dooing it like this ??)
+       // Update the cursor color. (a little slow doing it like this ??)
        setCursorColor();
 
        cursor_x_ = x;
@@ -154,13 +155,24 @@ void XScreen::removeCursor()
 
 void XScreen::expose(int x, int y, int w, int h)
 {
-       lyxerr[Debug::GUI] << "expose " << w << 'x' << h
+       lyxerr[Debug::GUI] << "XScreen::expose " << w << 'x' << h
                << '+' << x << '+' << y << endl;
-       XCopyArea(fl_get_display(),
-                 owner_.getPixmap(),
-                 owner_.getWin(),
-                 gc_copy,
-                 x, y, w, h,
-                 x + owner_.xpos(),
-                 y + owner_.ypos());
+
+       XEvent ev;
+
+       ev.type = Expose;
+       ev.xexpose.window = owner_.getWin();
+       // Adjust the x,y data so that XWorkArea can handle XEvents
+       // received from here in identical fashion to those it receives
+       // direct from X11.
+       ev.xexpose.x = owner_.xpos() + x;
+       ev.xexpose.y = owner_.ypos() + y;
+       ev.xexpose.width = w;
+       ev.xexpose.height = h;
+       ev.xexpose.count = 0;
+
+       XSendEvent(fl_get_display(), owner_.getWin(), False, 0, &ev);
 }
+
+} // namespace frontend
+} // namespace lyx