Fix notification reply window activation and focus
Ensures the reply window is raised using Qt::WindowActive state. This properly raises the window reliably (including from plasmoid, which didn't work at all before) and focuses the reply textbox.
... | ... | @@ -11,6 +11,11 @@ |
#include <dbushelper.h> | ||
#include <KPluginFactory> | ||
#include <KStartupInfo> | ||
#if !defined(Q_OS_WIN) && !defined(Q_OS_MAC) | ||
#include <QX11Info> | ||
#endif | ||
K_PLUGIN_CLASS_WITH_JSON(NotificationsPlugin, "kdeconnect_notifications.json") | ||
... | ... | @@ -152,6 +157,12 @@ void NotificationsPlugin::replyRequested(Notification* noti) |
SendReplyDialog* dialog = new SendReplyDialog(originalMessage, replyId, appName); | ||
connect(dialog, &SendReplyDialog::sendReply, this, &NotificationsPlugin::sendReply); | ||
dialog->show(); | ||
#if !defined(Q_OS_WIN) && !defined(Q_OS_MAC) | ||
auto window = qobject_cast<QWindow*>(dialog->windowHandle()); | ||
if (window && QX11Info::isPlatformX11()) { | ||
KStartupInfo::setNewStartupId(window, QX11Info::nextStartupId()); | ||
|
||
} | ||
#endif | ||
dialog->raise(); | ||
} | ||
... | ... |
-
mentioned in commit 5c7ff447
-
mentioned in commit plasma/plasma-workspace@3b801f8e
-
mentioned in commit eaec8888
-
mentioned in merge request !413 (merged)