From 990007a012442065c793cc6d43e5c1e1c4c568d8 Mon Sep 17 00:00:00 2001 From: Angus Leeming Date: Thu, 3 Oct 2002 11:25:01 +0000 Subject: [PATCH] Workaround for xforms bug, not hiding tooltip on dialog close. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5356 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/xforms/ChangeLog | 9 +++++++++ src/frontends/xforms/FormBase.C | 7 +++++++ src/frontends/xforms/FormBaseDeprecated.C | 7 +++++++ src/frontends/xforms/lyx_gui.C | 5 +++-- 4 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index fedad6633c..a2bbbba880 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,12 @@ +2002-10-03 Angus Leeming + + * lyx_gui.C (start): ev.xany.type is of type 'int' so print it as a + decimal not a hexadecimal. + + * FormBase.C (hide): + * FormBaseDeprecated.C (hide): ensure that tooltips are hidden along + with the dialog. + 2002-09-30 Angus Leeming * FormBase.[Ch]: diff --git a/src/frontends/xforms/FormBase.C b/src/frontends/xforms/FormBase.C index 545234c9ef..980ac632cc 100644 --- a/src/frontends/xforms/FormBase.C +++ b/src/frontends/xforms/FormBase.C @@ -28,6 +28,9 @@ extern "C" { +// This should be in forms.h but isn't +void fl_hide_tooltip(); + // Callback function invoked by xforms when the dialog is closed by the // window manager static int C_WMHideCB(FL_FORM * form, void *); @@ -161,6 +164,10 @@ void FormBase::show() void FormBase::hide() { + // Does no harm if none is visible and ensures that the tooltip form + // is hidden should the dialog be closed from the keyboard. + fl_hide_tooltip(); + // xforms sometimes tries to process a hint-type MotionNotify, and // use XQueryPointer, without verifying if the window still exists. // So we try to clear out motion events in the queue before the diff --git a/src/frontends/xforms/FormBaseDeprecated.C b/src/frontends/xforms/FormBaseDeprecated.C index 0984fb6bd2..7b2b0bd09f 100644 --- a/src/frontends/xforms/FormBaseDeprecated.C +++ b/src/frontends/xforms/FormBaseDeprecated.C @@ -32,6 +32,9 @@ extern "C" { +// This should be in forms.h but isn't +void fl_hide_tooltip(); + // Callback function invoked by xforms when the dialog is closed by the // window manager static int C_WMHideCB(FL_FORM *, void *); @@ -170,6 +173,10 @@ void FormBaseDeprecated::show() void FormBaseDeprecated::hide() { + // Does no harm if none is visible and ensures that the tooltip form + // is hidden should the dialog be closed from the keyboard. + fl_hide_tooltip(); + // xforms sometimes tries to process a hint-type MotionNotify, and // use XQueryPointer, without verifying if the window still exists. // So we try to clear out motion events in the queue before the diff --git a/src/frontends/xforms/lyx_gui.C b/src/frontends/xforms/lyx_gui.C index e796095505..1bfaf194ee 100644 --- a/src/frontends/xforms/lyx_gui.C +++ b/src/frontends/xforms/lyx_gui.C @@ -313,8 +313,9 @@ void lyx_gui::start(string const & batch, vector files) XEvent ev; fl_XNextEvent(&ev); lyxerr << "Received unhandled X11 event" << endl; - lyxerr << "Type: 0x" << hex << ev.xany.type << - " Target: 0x" << hex << ev.xany.window << dec << endl; + lyxerr << "Type: " << ev.xany.type + << " Target: 0x" << hex << ev.xany.window + << dec << endl; } } -- 2.39.2