From 84a6891d792fad7de6ded485ef0c29b17b865c5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sun, 1 Apr 2012 17:05:30 +0200 Subject: [PATCH] Add notifications for Window goes to/fro Fullscreen FEATURE: 124612 FIXED-IN: 4.9.0 REVIEW: 104457 --- geometry.cpp | 5 +++++ kwin.notifyrc | 8 ++++++++ notifications.cpp | 6 ++++++ notifications.h | 2 ++ 4 files changed, 21 insertions(+) diff --git a/geometry.cpp b/geometry.cpp index 277de7cc3b..92a23e311b 100644 --- a/geometry.cpp +++ b/geometry.cpp @@ -2353,6 +2353,11 @@ void Client::setFullScreen(bool set, bool user) if (was_fs != isFullScreen()) { emit clientFullScreenSet(this, set, user); emit fullScreenChanged(); + if (isFullScreen()) { + Notify::raise(Notify::FullScreen); + } else { + Notify::raise(Notify::UnFullScreen); + } } } diff --git a/kwin.notifyrc b/kwin.notifyrc index 483b32577e..716c5bd180 100644 --- a/kwin.notifyrc +++ b/kwin.notifyrc @@ -7424,3 +7424,11 @@ Comment[x-test]=xxTiling Layout has been changedxx Comment[zh_CN]=已更改平铺布局 Comment[zh_TW]=鋪排佈局已變更 Action=Popup + +[Event/fullscreen] +Name=Window Fullscreen Set +Comment=A window has been set to fullscreen + +[Event/unfullscreen] +Name=Window Fullscreen Restored +Comment=A window has been restored from fullscreen diff --git a/notifications.cpp b/notifications.cpp index 2f0ee201af..b3b30f5d02 100644 --- a/notifications.cpp +++ b/notifications.cpp @@ -104,6 +104,12 @@ bool Notify::raise(Event e, const QString& message, Client* c) case TilingLayoutChanged: event = "tilinglayoutchanged"; break; + case FullScreen: + event = "fullscreen"; + break; + case UnFullScreen: + event = "unfullscreen"; + break; default: if ((e > DesktopChange) && (e <= DesktopChange + 20)) { event = QString("desktop%1").arg(e - DesktopChange); diff --git a/notifications.h b/notifications.h index 8b92a6737b..bc34bf8555 100644 --- a/notifications.h +++ b/notifications.h @@ -59,6 +59,8 @@ public: DemandAttentionOther, CompositingSuspendedDbus, TilingLayoutChanged, + FullScreen, + UnFullScreen, DesktopChange = 100 };