+2002-02-28 John Levon <moz@compsoc.man.ac.uk>
+
+ * FormBase.C:
+ * FormBaseDeprecated.C:
+ * FormFiledialog.C: possible fix to the Bad Window problems that some
+ people have been experiencing.
+
2002-02-28 Angus Leeming <a.leeming@ic.ac.uk>
* FormForks.C (input_button_all): resolve comparison between signed
#include "Dialogs.h"
#include "FormBase.h"
#include "xformsBC.h"
+#include "GUIRunTime.h"
#include "support/LAssert.h"
#include "Tooltips.h"
#include "xforms_helpers.h" // formatted
void FormBase::hide()
{
+ // 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
+ // DestroyNotify
+ XSync(fl_get_display(), false);
+ GUIRunTime::processEvents();
+
if (form() && form()->visible)
fl_hide_form(form());
}
#include "Dialogs.h"
#include "FormBaseDeprecated.h"
#include "LyXView.h"
+#include "GUIRunTime.h"
#include "support/LAssert.h"
#include "xformsBC.h"
#include "lyxrc.h"
void FormBaseDeprecated::hide()
{
+ // 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
+ // DestroyNotify
+ XSync(fl_get_display(), false);
+ GUIRunTime::processEvents();
+
if (form() && form()->visible) {
// some dialogs might do things to the form first
// such as the nested tabfolder problem in Preferences
return string(".");
}
+namespace {
+ bool x_sync_kludge(bool ret)
+ {
+ XSync(fl_get_display(), false);
+ return ret;
+ }
+} // namespace anon
// RunDialog: handle dialog during file selection
bool FileDialog::Private::RunDialog()
{
force_cancel = false;
force_ok = false;
-
+
// event loop
while (true) {
FL_OBJECT * pObject = fl_do_forms();
if (pObject == pFileDlgForm->Ready) {
if (HandleOK())
- return true;
+ return x_sync_kludge(true);
+
} else if (pObject == pFileDlgForm->Cancel
|| force_cancel)
- return false;
+ return x_sync_kludge(false);
+
else if (force_ok)
- return true;
+ return x_sync_kludge(true);
}
}