Work around present() not actually raising windows under Wayland.
This uses the method of using present_with_time() with value instead of Gdk.CURRENT_TIME as the arg value, as suggested in Bug 766284. Fixes Bug 776881 under Wayland, maybe also under X11. * src/client/application/geary-application.vala (GearyApplication), src/client/composer/composer-container.vala (ComposerContainer): Use workaround in present(). * src/client/application/geary-controller.vala (GearyController), src/client/application/secret-mediator.vala (SecretMediator): Use GearyApplication.present() instead of calling it directly on the main window, as needed. * src/client/composer/composer-embed.vala (ComposerEmbed): Just use the base class's present rather that duplicating the old implementation.
This commit is contained in:
parent
2228fe73e7
commit
e333794f61
5 changed files with 30 additions and 27 deletions
|
|
@ -222,9 +222,12 @@ public class GearyApplication : Gtk.Application {
|
|||
if (controller.main_window == null)
|
||||
return false;
|
||||
|
||||
// When the app is started hidden, show_all() never gets
|
||||
// called, do so here to prevent an empty window appearing.
|
||||
controller.main_window.present();
|
||||
// Use present_with_time and a made up time so the present
|
||||
// actually works, as a work around for Bug 766284
|
||||
// <https://bugzilla.gnome.org/show_bug.cgi?id=766284>.
|
||||
this.controller.main_window.present_with_time(
|
||||
(uint32) (get_real_time() / 1000)
|
||||
);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1437,13 +1437,11 @@ public class GearyController : Geary.BaseObject {
|
|||
if (conversation != null)
|
||||
main_window.conversation_list_view.select_conversation(conversation);
|
||||
}
|
||||
|
||||
|
||||
private void on_indicator_activated_application(uint32 timestamp) {
|
||||
// When the app is started hidden, show_all() never gets
|
||||
// called, do so here to prevent an empty window appearing.
|
||||
main_window.present_with_time(timestamp);
|
||||
this.application.present();
|
||||
}
|
||||
|
||||
|
||||
private void on_indicator_activated_composer(uint32 timestamp) {
|
||||
on_indicator_activated_application(timestamp);
|
||||
on_new_message(null);
|
||||
|
|
@ -2286,7 +2284,7 @@ public class GearyController : Geary.BaseObject {
|
|||
|
||||
// Find out what to do with the inline composers.
|
||||
// TODO: Remove this in favor of automatically saving drafts
|
||||
main_window.present();
|
||||
this.application.present();
|
||||
Gee.List<ComposerWidget> composers_to_destroy = new Gee.ArrayList<ComposerWidget>();
|
||||
foreach (ComposerWidget cw in composer_widgets) {
|
||||
if (cw.state != ComposerWidget.ComposerState.DETACHED)
|
||||
|
|
@ -2468,17 +2466,17 @@ public class GearyController : Geary.BaseObject {
|
|||
&& !current_folder.properties.is_local_only && current_account != null
|
||||
&& (current_folder as Geary.FolderSupport.Move) != null);
|
||||
}
|
||||
|
||||
|
||||
public bool confirm_delete(int num_messages) {
|
||||
main_window.present();
|
||||
this.application.present();
|
||||
ConfirmationDialog dialog = new ConfirmationDialog(main_window, ngettext(
|
||||
"Do you want to permanently delete this message?",
|
||||
"Do you want to permanently delete these messages?", num_messages),
|
||||
null, _("Delete"), "destructive-action");
|
||||
|
||||
|
||||
return (dialog.run() == Gtk.ResponseType.OK);
|
||||
}
|
||||
|
||||
|
||||
private async void archive_or_delete_selection_async(bool archive, bool trash,
|
||||
Cancellable? cancellable) throws Error {
|
||||
if (!can_switch_conversation_view())
|
||||
|
|
|
|||
|
|
@ -115,18 +115,19 @@ public class SecretMediator : Geary.CredentialsMediator, Object {
|
|||
// to serialize the code
|
||||
int token = yield dialog_mutex.claim_async(null);
|
||||
|
||||
// If the main window is hidden, make it visible now and present to user as transient parent
|
||||
Gtk.Window? main_window = this.instance.get_active_window();
|
||||
if (main_window != null && !main_window.visible) {
|
||||
main_window.present_with_time(Gdk.CURRENT_TIME);
|
||||
}
|
||||
// Ensure main window present to the window
|
||||
this.instance.present();
|
||||
|
||||
PasswordDialog password_dialog = new PasswordDialog(main_window, services.has_smtp(),
|
||||
account_information, services);
|
||||
PasswordDialog password_dialog = new PasswordDialog(
|
||||
this.instance.get_active_window(),
|
||||
services.has_smtp(),
|
||||
account_information,
|
||||
services
|
||||
);
|
||||
bool result = password_dialog.run();
|
||||
|
||||
|
||||
dialog_mutex.release(ref token);
|
||||
|
||||
|
||||
if (!result) {
|
||||
// user cancelled the dialog
|
||||
imap_password = null;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,12 @@ public interface ComposerContainer {
|
|||
public abstract Gtk.ApplicationWindow top_window { get; }
|
||||
|
||||
public virtual void present() {
|
||||
this.top_window.present();
|
||||
// Use present_with_time and a made up time so the present
|
||||
// actually works, as a work around for Bug 766284
|
||||
// <https://bugzilla.gnome.org/show_bug.cgi?id=766284>.
|
||||
this.top_window.present_with_time(
|
||||
(uint32) (get_real_time() / 1000)
|
||||
);
|
||||
}
|
||||
|
||||
public virtual unowned Gtk.Widget get_focus() {
|
||||
|
|
|
|||
|
|
@ -186,10 +186,6 @@ public class ComposerEmbed : Gtk.EventBox, ComposerContainer {
|
|||
return ret;
|
||||
}
|
||||
|
||||
public void present() {
|
||||
top_window.present();
|
||||
}
|
||||
|
||||
public void vanish() {
|
||||
hide();
|
||||
this.composer.state = ComposerWidget.ComposerState.DETACHED;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue