]> Dogcows Code - chaz/openbox/blobdiff - otk/messagedialog.cc
make DialogButtons take char*'s meaning that the label will always be Utf-8
[chaz/openbox] / otk / messagedialog.cc
index 216189818cd224f184bee4c1b80321de59c7a433..b1f6c61af7abf580f11ee338b0efeb2c63ca46c5 100644 (file)
@@ -112,6 +112,12 @@ const DialogButton& MessageDialog::run()
   return *_result;
 }
 
+void MessageDialog::focus()
+{
+  if (visible())
+    XSetInputFocus(**display, window(), None, CurrentTime);
+}
+
 void MessageDialog::show()
 {
   std::vector<DialogButton>::const_iterator it, end = _buttons.end();
@@ -162,9 +168,9 @@ void MessageDialog::keyPressHandler(const XKeyEvent &e)
     for (it = _buttons.begin(); it != end; ++it)
       if (it->isDefault()) {
        _result = &(*it);
+       hide();
        break;
       }
-    hide();
   } else if (e.keycode == _escape) {
     hide();
   }
This page took 0.022102 seconds and 4 git commands to generate.