From fc325dc01f07edddc460ea1e0c4bb44209449b62 Mon Sep 17 00:00:00 2001 From: Martin Date: Wed, 7 Nov 2018 15:53:55 +0100 Subject: [PATCH] Don't use RequestUserAttention on Linux because it segfaults --- Status.cpp | 2 ++ TrayIcon.cpp | 6 ++++++ main.cpp | 6 +++--- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Status.cpp b/Status.cpp index 599045f..7520c85 100644 --- a/Status.cpp +++ b/Status.cpp @@ -118,7 +118,9 @@ Status::Status(wxWindow* parent, wxLongLong_t follow_only_process_id) SetFocus(); Raise(); Show(true); +#if !defined(__WXMAC__) && !defined(__linux__) RequestUserAttention(); +#endif if (follow_only_process_id == 0) { diff --git a/TrayIcon.cpp b/TrayIcon.cpp index cba5315..b387c70 100644 --- a/TrayIcon.cpp +++ b/TrayIcon.cpp @@ -237,7 +237,9 @@ void TrayIcon::OnPopupClick(wxCommandEvent &evt) { Info::getInstance()->SetFocus(); Info::getInstance()->Raise(); +#if !defined(__WXMAC__) && !defined(__linux__) Info::getInstance()->RequestUserAttention(); +#endif } else { @@ -250,7 +252,9 @@ void TrayIcon::OnPopupClick(wxCommandEvent &evt) { Status::getInstance()->SetFocus(); Status::getInstance()->Raise(); +#if !defined(__WXMAC__) && !defined(__linux__) Status::getInstance()->RequestUserAttention(); +#endif } else { @@ -301,7 +305,9 @@ void TrayIcon::OnClick(wxCommandEvent &evt) { Status::getInstance()->SetFocus(); Status::getInstance()->Raise(); +#if !defined(__WXMAC__) && !defined(__linux__) Status::getInstance()->RequestUserAttention(); +#endif } else { diff --git a/main.cpp b/main.cpp index aef9c8b..8a7c6a4 100644 --- a/main.cpp +++ b/main.cpp @@ -875,9 +875,9 @@ void MyTimer::Notify() wxMessageDialog* dialog = new wxMessageDialog(NULL, ask_msg, _("UrBackup - Allow restore"), wxOK | wxCANCEL); -#ifndef __WXMAC__ +#if !defined(__WXMAC__) && !defined(__linux__) dialog->RequestUserAttention(); - #endif +#endif int rc = dialog->ShowModal(); dialog->Destroy(); if(rc == wxID_OK) @@ -907,7 +907,7 @@ void MyTimer::Notify() wxMessageDialog* dialog = new wxMessageDialog(NULL, _("Some files could not be deleted or overwritten during the restore process. In order to overwrite/delete the files the system needs to be restarted. Do you want to do this now?"), _("UrBackup - Restart Windows"), wxOK | wxCANCEL); - #ifndef __WXMAC__ + #if !defined(__WXMAC__) && !defined(__linux__) dialog->RequestUserAttention(); #endif if(dialog->ShowModal() == wxID_OK)