mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-25 19:07:45 +00:00
Revert the XForms 'intelligent graphics exposure' patch because it is
currently breaking selection, etc. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9327 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
37e82a5463
commit
b6cb6b2a38
@ -1,3 +1,11 @@
|
|||||||
|
2004-11-26 Angus Leeming <leeming@lyx.org>
|
||||||
|
|
||||||
|
* xscreen.C:
|
||||||
|
* XWorkArea.C: revert the 2004-05-04 patch that used graphics
|
||||||
|
exposure events to paint the changing screen efficiently. It
|
||||||
|
currently results in spurious release events being emitted,
|
||||||
|
buggering up selection, etc.
|
||||||
|
|
||||||
2004-11-29 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
|
2004-11-29 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
|
||||||
|
|
||||||
* input_validators.C: use support::contains instead of strchr
|
* input_validators.C: use support::contains instead of strchr
|
||||||
|
@ -175,9 +175,8 @@ XWorkArea::XWorkArea(LyXView & owner, int w, int h)
|
|||||||
XGCValues val;
|
XGCValues val;
|
||||||
|
|
||||||
val.function = GXcopy;
|
val.function = GXcopy;
|
||||||
val.graphics_exposures = false;
|
|
||||||
copy_gc = XCreateGC(fl_get_display(), RootWindow(fl_get_display(), 0),
|
copy_gc = XCreateGC(fl_get_display(), RootWindow(fl_get_display(), 0),
|
||||||
GCFunction | GCGraphicsExposures, &val);
|
GCFunction, &val);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -189,13 +188,17 @@ XWorkArea::~XWorkArea()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void XWorkArea::updateGeometry(int width, int height)
|
void XWorkArea::redraw(int width, int height)
|
||||||
{
|
{
|
||||||
static int cur_width = -1;
|
static int cur_width = -1;
|
||||||
static int cur_height = -1;
|
static int cur_height = -1;
|
||||||
|
|
||||||
if (cur_width == width && cur_height == height && workareapixmap)
|
if (cur_width == width && cur_height == height && workareapixmap) {
|
||||||
|
XCopyArea(fl_get_display(),
|
||||||
|
getPixmap(), getWin(), copy_gc,
|
||||||
|
0, 0, width, height, xpos(), ypos());
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
cur_width = width;
|
cur_width = width;
|
||||||
cur_height = height;
|
cur_height = height;
|
||||||
@ -219,20 +222,6 @@ void XWorkArea::updateGeometry(int width, int height)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void XWorkArea::paint(int x, int y, int w, int h)
|
|
||||||
{
|
|
||||||
lyxerr[Debug::WORKAREA]
|
|
||||||
<< "XWorkarea::paint " << w << 'x' << h
|
|
||||||
<< '+' << x << '+' << y << endl;
|
|
||||||
|
|
||||||
updateGeometry(workWidth(), workHeight());
|
|
||||||
XCopyArea(fl_get_display(),
|
|
||||||
getPixmap(), getWin(),
|
|
||||||
copy_gc, x, y, w, h,
|
|
||||||
work_area->x + x, work_area->y + y);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void XWorkArea::setScrollbarParams(int height, int pos, int line_height)
|
void XWorkArea::setScrollbarParams(int height, int pos, int line_height)
|
||||||
{
|
{
|
||||||
// we need to cache this for scroll_cb
|
// we need to cache this for scroll_cb
|
||||||
@ -295,7 +284,7 @@ int XWorkArea::work_area_handler(FL_OBJECT * ob, int event,
|
|||||||
FL_Coord, FL_Coord,
|
FL_Coord, FL_Coord,
|
||||||
int key, void * xev)
|
int key, void * xev)
|
||||||
{
|
{
|
||||||
if (event != 11)
|
if (event != 10 && event != 11)
|
||||||
lyxerr[Debug::WORKAREA] << "Workarea event: EVENT: " << event << endl;
|
lyxerr[Debug::WORKAREA] << "Workarea event: EVENT: " << event << endl;
|
||||||
|
|
||||||
XEvent * ev = static_cast<XEvent*>(xev);
|
XEvent * ev = static_cast<XEvent*>(xev);
|
||||||
@ -306,35 +295,12 @@ int XWorkArea::work_area_handler(FL_OBJECT * ob, int event,
|
|||||||
|
|
||||||
switch (event) {
|
switch (event) {
|
||||||
|
|
||||||
case FL_DRAW: {
|
case FL_DRAW:
|
||||||
if (!area->work_area || !area->work_area->form->visible)
|
if (!area->work_area || !area->work_area->form->visible)
|
||||||
return 1;
|
return 1;
|
||||||
|
lyxerr[Debug::WORKAREA] << "Workarea event: DRAW" << endl;
|
||||||
if (ev) {
|
area->redraw(area->workWidth(), area->workHeight());
|
||||||
lyxerr[Debug::WORKAREA]
|
|
||||||
<< "work_area_handler, handling X11 "
|
|
||||||
"expose event "
|
|
||||||
<< ev->xexpose.width << 'x'
|
|
||||||
<< ev->xexpose.height << '+'
|
|
||||||
<< ev->xexpose.x << '+'
|
|
||||||
<< ev->xexpose.y << endl;
|
|
||||||
|
|
||||||
// X11 generates XEvents with x, y relative to the
|
|
||||||
// top left corner of the window.
|
|
||||||
// XScreen::expose emulates this behaviour.
|
|
||||||
// We therefore need to remove this offset before
|
|
||||||
// generating the pixmap.
|
|
||||||
int const x = ev->xexpose.x - ob->x;
|
|
||||||
int const y = ev->xexpose.y - ob->y;
|
|
||||||
|
|
||||||
area->paint(x, y,
|
|
||||||
ev->xexpose.width, ev->xexpose.height);
|
|
||||||
} else
|
|
||||||
area->paint(0, 0,
|
|
||||||
area->workWidth(), area->workHeight());
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
case FL_PUSH:
|
case FL_PUSH:
|
||||||
if (!ev || ev->xbutton.button == 0) break;
|
if (!ev || ev->xbutton.button == 0) break;
|
||||||
|
@ -67,10 +67,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
/// generate the pixmap, and copy backing pixmap to it,
|
/// generate the pixmap, and copy backing pixmap to it,
|
||||||
/// and send resize event if needed
|
/// and send resize event if needed
|
||||||
void updateGeometry(int, int);
|
void redraw(int, int);
|
||||||
|
|
||||||
///
|
|
||||||
void paint(int x, int y, int w, int h);
|
|
||||||
|
|
||||||
/// GC used for copying to the screen
|
/// GC used for copying to the screen
|
||||||
GC copy_gc;
|
GC copy_gc;
|
||||||
|
@ -158,20 +158,13 @@ void XScreen::expose(int x, int y, int w, int h)
|
|||||||
lyxerr[Debug::GUI] << "XScreen::expose " << w << 'x' << h
|
lyxerr[Debug::GUI] << "XScreen::expose " << w << 'x' << h
|
||||||
<< '+' << x << '+' << y << endl;
|
<< '+' << x << '+' << y << endl;
|
||||||
|
|
||||||
XEvent ev;
|
XCopyArea(fl_get_display(),
|
||||||
|
owner_.getPixmap(),
|
||||||
ev.type = Expose;
|
owner_.getWin(),
|
||||||
ev.xexpose.window = owner_.getWin();
|
gc_copy,
|
||||||
// Adjust the x,y data so that XWorkArea can handle XEvents
|
x, y, w, h,
|
||||||
// received from here in identical fashion to those it receives
|
x + owner_.xpos(),
|
||||||
// direct from X11.
|
y + owner_.ypos());
|
||||||
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 frontend
|
||||||
|
Loading…
Reference in New Issue
Block a user