[vlc-devel] [PATCH] dbus control: Support Raise command

Kai Uwe Broulik kde at privat.broulik.de
Tue Aug 9 11:21:30 CEST 2016


The infrastructure for bringing the window to the front was already in place
but it would not open the window when it was hidden in e.g. the system tray.
This patch addresses this and changes CanRaise to return true.
---
  modules/control/dbus/dbus_root.c  | 2 +-
  modules/gui/qt/main_interface.cpp | 9 +++++++++
  2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/modules/control/dbus/dbus_root.c  
b/modules/control/dbus/dbus_root.c
index 8b0ed71..a61b264 100644
--- a/modules/control/dbus/dbus_root.c
+++ b/modules/control/dbus/dbus_root.c
@@ -168,7 +168,7 @@ static int
  MarshalCanRaise( intf_thread_t *p_intf, DBusMessageIter *container )
  {
      VLC_UNUSED( p_intf );
-    const dbus_bool_t b_ret = FALSE;
+    const dbus_bool_t b_ret = TRUE;

      if (!dbus_message_iter_append_basic( container,  
DBUS_TYPE_BOOLEAN, &b_ret ))
          return VLC_ENOMEM;
diff --git a/modules/gui/qt/main_interface.cpp  
b/modules/gui/qt/main_interface.cpp
index 81eea83..e153cc9 100644
--- a/modules/gui/qt/main_interface.cpp
+++ b/modules/gui/qt/main_interface.cpp
@@ -1646,6 +1646,15 @@ void MainInterface::emitRaise()
  }
  void MainInterface::setRaise()
  {
+    if( isHidden() )
+    {
+        show();
+    }
+    else if( isMinimized() )
+    {
+        showNormal();
+    }
+
      activateWindow();
      raise();
  }
-- 
2.7.4





More information about the vlc-devel mailing list