From: Dan Breslau Date: Fri, 1 Apr 2016 20:16:38 +0000 (-0400) Subject: The problem was that simply calling Window.show() doesn't mean that the window X-Git-Tag: v0.9.6~28 X-Git-Url: http://www.project-moonshot.org/gitweb/?p=moonshot-ui.git;a=commitdiff_plain;h=81776e951fb2848d2bc6706223697bf29bedba90 The problem was that simply calling Window.show() doesn't mean that the window is brought to the foreground. Actually, there seems to be nothing that guarantees this, because the user's settings and choice of window manager may ffect the behavior. However, some research and experimentation shows that calling these two Window methods set_urgency_hint(true); present(); may not bring the window to the foreground either, but do at least causes the user to be notified that the window wants attention, much like the way Windows may make a taskbar icon flash orange. --- diff --git a/src/moonshot-identity-management-view.vala b/src/moonshot-identity-management-view.vala index d9d7c5a..2088e49 100644 --- a/src/moonshot-identity-management-view.vala +++ b/src/moonshot-identity-management-view.vala @@ -511,11 +511,26 @@ public class IdentityManagerView : Window { filter.refilter(); redraw_id_card_widgets (); set_prompting_service(request.service); - show (); + make_visible(); } this.request_queue.push_tail (request); } + + /** Makes the window visible, or at least, notifies the user that the window + * wants to be visible. + * + * This differs from show() in that show() does not guarantee that the + * window will be moved to the foreground. Actually, neither does this + * method, because the user's settings and window manager may affect the + * behavior significantly. + */ + public void make_visible() + { + set_urgency_hint(true); + present(); + } + public IdCard check_add_password(IdCard identity, IdentityRequest request, IdentityManagerModel model) { IdCard retval = identity; diff --git a/src/moonshot-identity-manager-app.vala b/src/moonshot-identity-manager-app.vala index a013cfb..0838f66 100644 --- a/src/moonshot-identity-manager-app.vala +++ b/src/moonshot-identity-manager-app.vala @@ -67,7 +67,7 @@ public class IdentityManagerApp { private const int WINDOW_WIDTH = 400; private const int WINDOW_HEIGHT = 500; public void show() { - if (view != null) view.show(); + if (view != null) view.make_visible(); } public IdentityManagerApp (bool headless, bool use_flat_file_store) {