Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have recently acquired a second display for use with my laptop running Ubuntu with xfce and compiz.

However, one thing that has been bugging me is window switching: my second monitor has 2 windows open which would usually be on my 2nd workspace.

Now, when I switch windows, I will accidentally switch to one of the other windows on the 2nd display which is kind of annoying.

How to fix this issue ?

share|improve this question
    
Are you opposed to usingKDE? Good recall of dual monitor layouts and fully customizable desktop switching is why I switched from XFCE and Unity to KDE –  virtualxtc Jan 14 at 17:35
    
@virtualxtc I tried KDE and I really like it. However, I have not found how to customize desktop switching in KDE such that only windows on the current workspace and display are on the ALT+TAB list. Would you care to write an answer that describes how to do this? I would award you the bounty for that. Thanks. –  Malte Skoruppa Jan 19 at 15:14
add comment

3 Answers

up vote 2 down vote accepted
+50

I'm not sure about Unity or XFCE, but fully customizable desktop switching is one of the many reasons I choose to run KDE (Kubuntu).

In KDE to limit task switching to the current screen do the following:

  • Press Alt+F2 and type task switcher and then select Task Switcher from the drop-down list.

  • Inside the task switcher control panel's main tab there is a section called Filter windows by.

  • Select the check box for Virtual Desktops, Activities, and Screens, and select the Current activity option for each.

  • Press Apply, and verify things work as expected before closing.


Note: You can also find "Task Switcher" by doing the following:

  • click on the Kick Off menu

    -- Navigate to the Computer tab

  • click on the System Settings menu

    -- Under the Workspace Appearance and Behavior section choose Window Behavior


Related: What is a activity in KDE and what can I do with it?

share|improve this answer
    
Many thanks! This is awesome. I'm very seriously considering switching to KDE, as apparently this is the only desktop environment able to handle multiple monitors intelligently. But I have one more question: how did you find out how to do that? The Alt+F2 solution is fine once you know it is called Task Switcher, but it may as well have been called Window Switcher or Alt+Tab behavior or whatever. Is there some comprehensible overview somewhere in KDE over such settings where you can actually find them even when you don't know what they are called? –  Malte Skoruppa Jan 21 at 19:41
    
See above edit (I removed my comments as they no longer add to the discussion). –  virtualxtc Jan 27 at 19:42
    
Perfect, it's good to know there's such a way. Things can be found via keywords, but sometimes it's easier to look them up via more classical ways. :) –  Malte Skoruppa Jan 28 at 1:32
add comment

Whether you're using compiz, xfwm4 or any other WM, you can use a flexible desktop-independent task-switcher like Skippy-XD. As explained in this upstream thread, you can configure Skippy-XD (in ~/.config/skippy-xd/skippy-xd.rc for a particular user, or in /etc/xdg/skippy-xd.rc for all users) so as:

  • To avoid displaying windows from other virtual desktops, set [general] -> showAllDesktops to false. Should work on most EWMH compliant WMs.
  • To avoid displaying windows from other Xinerama screens, set [xinerama] -> showAll to false.
  • To avoid displaying windows from other, separate X displays, set [general] -> includeAllScreens to false. (But this is a hidden switch and is disabled by default.)

See Something like 'Mac OS X exposé' / 'Compiz Scale' / 'KDE Present Windows' in Openbox / LXDE / Xfce? for some usage and installation details. Basically you can install latest development packages from Skippy-XD PPA (daily). Then you can bind skippy-xd command to Alt + Tab or Alt + Esc or whatever. When set up appropriately, as explained above, Skippy-XD should display only the windows from the current virtual desktop and monitor.

share|improve this answer
1  
Hey, I tested that and it works! Many thanks, this is a good addition. –  Malte Skoruppa Jan 22 at 21:36
    
Cool! Vain as it may be, I was actually aiming at the bounty which is now gone. :) But if this solution allows you to keep using Xfce (and/or Skippy-XD), then I'll be happy with that, too. –  landroni Jan 22 at 21:45
    
Yes, so sorry, but I had already awarded it before you even wrote this answer. And that other answer I gave the bounty to was really helpful too. I actually like KDE. Let's see what I will end up using; I don't yet know myself. Thank you for your help at any rate, it was definitely enlightening :) –  Malte Skoruppa Jan 22 at 21:59
    
No, don't worry, I also think the KDE answer is useful and more deserving of the bounty than my previous answer. –  landroni Jan 22 at 22:04
    
@landroni my bad. Guess I shoudld delete my comment .... –  virtualxtc Jan 27 at 20:22
add comment

To my knowledge Xfce 4.10 (and I assume that this is what you use) has only limited support for additional monitors.

In this respect 4.12 will support extended desktop mode for multiple monitors (see design/xfce4-settings/display for details), which hopefully would fix the issues that you're seeing. You can try out the development snapshots from the ppa:xubuntu-dev/xfce-4.12 PPA.

Or perhaps you simply need to follow the advice in this question: How do I setup dual monitors in Xfce?. Either way, currently there seems to be a limitation in xfwm4 (if this is what you're using), specifically that it cycles through all the windows on current workspace, whether you use one monitor or two. For details see upstream bug report.

share|improve this answer
    
I see, thanks! I'm getting a new laptop in two days, so I'll be switching to Unity since it'll be able to handle that a lot easier than my current ageing laptop. –  zhongfu Jan 16 at 9:39
    
I tried the Xfce 4.12 development snapshot from the PPA, however it does not seem to solve the problem, unfortunately. –  Malte Skoruppa Jan 19 at 15:12
    
@MalteSkoruppa Does the same issue happen if you use xfwm4? –  landroni Jan 19 at 16:06
    
Yes, I was using xfwm4 actually. The Alt+Tab mechanism shows windows from all displays (i.e., monitors), not only those that are on the current display (where "current display" means the one where the currently active window lies). –  Malte Skoruppa Jan 19 at 20:47
    
Thanks for the link to the bug report. So it looks like it is a known issue, but the Xfce devs chose to ignore it, or have had other priorities for the last one and half years or so (when that report was submitted). I still gave the bounty to virtualxtc as I promised in a comment to the original question, but it is your answer I would mark as accepted if the question was mine, since it actually answers the original question (How to do it in Xfce?) best: It ain't possible ;) –  Malte Skoruppa Jan 21 at 20:11
show 1 more comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.