This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Virtual Desktops Switching

Tags: None
(comma "," separated)
User avatar
starbuck
Registered Member
Posts
60
Karma
0
OS

Virtual Desktops Switching

Fri Sep 21, 2012 3:45 pm
Hello,

is there any qdbus-command to switch explicitly to a specific Desktop, for example Desktop1?
There are keyboard shortcuts mapped default to that CTRL+F1 and CTRL+F2, but I don't know how to invoke them with qdbus.

Another option would be:

There is a difference between assigning switch to "next desktop" with shortcut keys and "qdbus org.kde.kwin /KWin org.kde.KWin.nextDesktop"

If I assign a Global Key under Settings - Workspace Behaviour - Virtual Desktops - Switching - Switch to Next Desktop",
then this key switches to next desktop until last desktop and then stops (which is what I want also for the qdbus command),
while "qdbus org.kde.kwin /KWin org.kde.KWin.nextDesktop" assigned to a Global Shortcut Command/Url goes back to the first desktop if pressed again?

Is there any way to assign a qdbus command that also stops at last desktop and another one respectively at first desktop?
Minio
Registered Member
Posts
177
Karma
1
OS

Re: Virtual Desktops Switching  Topic is solved

Fri Sep 21, 2012 4:33 pm
starbuck wrote:is there any qdbus-command to switch explicitly to a specific Desktop, for example Desktop1?


Code: Select all
qdbus org.kde.kwin /KWin org.kde.KWin.setCurrentDesktop 1


Best regards
Mirosław Zalewski
User avatar
starbuck
Registered Member
Posts
60
Karma
0
OS

Re: Virtual Desktops Switching

Fri Sep 21, 2012 4:39 pm
Thanks Minio, that works in this case (as I only have two desktops) :)

As for a more than two desktops scenario:
I just noticed that when you TICK "Desktop navigation wraps around", a Keyboard shortcut assigned to "Switch to Next Desktop" behaves the same way as the qdbus command nextDesktop.
Just when you UNTICK it, the shortcut stops flipping back to first desktop, while a shortcut invoking the qdbus command ignores this setting and continues to "warp to first".
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: Virtual Desktops Switching

Sun Sep 23, 2012 3:19 am
Interesting behaviour. This is probably due to the implementation of this option.
I'm going to move this to the KWin forum so the KWin developers can see this and comment.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
luebking
Karma
0

Re: Virtual Desktops Switching

Sun Sep 23, 2012 10:49 pm
there's indeed
void Workspace::nextDesktop()
as well as
void Workspace::slotSwitchDesktopNext()
where only the latter has support for options->isRollOverDesktops()

No idea whether that's intended or just cruft.
User avatar
starbuck
Registered Member
Posts
60
Karma
0
OS

Re: Virtual Desktops Switching

Mon Sep 24, 2012 8:10 am
so is there a dbus command for Workspace::slotSwitchDesktopNext() ?
mgraesslin
KDE Developer
Posts
572
Karma
7
OS

Re: Virtual Desktops Switching

Mon Sep 24, 2012 4:35 pm
starbuck wrote:so is there a dbus command for Workspace::slotSwitchDesktopNext() ?

no, but it's part of the KWin Scripting Interface and in general KWin accepts scripts through D-Bus. Though it's tricky and in general I would not recommend to use that.
luebking
Karma
0

Re: Virtual Desktops Switching

Mon Sep 24, 2012 6:16 pm
the question actually is whether the differently behaving nextDesktop() function is there by intent or just rotten code (so that the dbus interface should rather bind to slotSwitchDesktopNext
mgraesslin
KDE Developer
Posts
572
Karma
7
OS

Re: Virtual Desktops Switching

Mon Sep 24, 2012 6:28 pm
luebking wrote:the question actually is whether the differently behaving nextDesktop() function is there by intent or just rotten code (so that the dbus interface should rather bind to slotSwitchDesktopNext

5 EUR on rotten code and another 5 on git blame won't tell us (ending in our moving commit for kwin III)
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS

Re: Virtual Desktops Switching

Wed Sep 26, 2012 9:22 am
Have you tried the "-M" and "-C" options to git blame?


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
mgraesslin
KDE Developer
Posts
572
Karma
7
OS

Re: Virtual Desktops Switching

Wed Sep 26, 2012 4:19 pm
bcooksley wrote:Have you tried the "-M" and "-C" options to git blame?

just did so for the code in question:

Code: Select all
commit 05507ee2939e4d5420f3c9599d00986906d61959
Author: Luboš Luňák <l.lunak@kde.org>
Date:   Sun Apr 29 17:35:43 2007 +0000

    branches/work/kwin_composite becomes new trunk kwin.
   
   
    svn path=/trunk/KDE/kdebase/workspace/; revision=659202


Bookmarks



Who is online

Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft