# HG changeset patch # User John Donoghue # Date 1374166694 14400 # Node ID c2e43dd6eb708ff679ea9e1e608d7101667aa5d4 # Parent 84db9338c448ff777691c8214d38b166f035ee23 Dont display find dialog out of desktop bounds (bug #39518) * libgui/src/m-editor/find-dialog.cc: (find_dialog::find_dialog): Check dialog bounds against desktop dize before settings dialog position. diff -r 84db9338c448 -r c2e43dd6eb70 libgui/src/m-editor/find-dialog.cc --- a/libgui/src/m-editor/find-dialog.cc Thu Jul 18 17:55:53 2013 -0400 +++ b/libgui/src/m-editor/find-dialog.cc Thu Jul 18 12:58:14 2013 -0400 @@ -158,7 +158,17 @@ _find_next_button->setDefault (true); _find_result_available = false; - move (p->x() + p->frameGeometry ().width (), p->y()); + // move to dialog to side of the parent if there is room on the desktop to do so. + QWidget * desktop = QApplication::desktop (); + int xp = p->x () + p->frameGeometry ().width (); + int yp= p->y (); + if (desktop != 0 && sizeHint ().isValid ()) + { + if (xp + sizeHint ().width () > desktop->width ()) + xp = desktop->width () - sizeHint ().width (); + } + + move (xp, yp); }