Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - Desktop
User Name
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.


  Search this Thread
Old 11-29-2009, 11:24 AM   #1
Registered: Mar 2005
Posts: 284

Rep: Reputation: 33
[SOLVED] When second monitor loses focus, mouse click won't bring it back again

Hello forum,

I am running KDE 4.3.3 on a recent Gentoo distribution and I have a separate X screen for my second monitor which is a wide-screen TV connected to the TV-out of a Nvidia graphics card using a component output. So I have a first monitor and a second monitor.

I have MythTV up and running on my wide-screen TV (second monitor) but the second monitor only has focus (active) when MythTV first launches. Once I click my mouse on my first monitor, MythTV loses focus and I can not get the focus back even if I click my mouse on the MythTV application in the second monitor. At this point I have no keyboard control on the second monitor. The only way to get window focus back to the second monitor is to kill MythTV and re-start it.

I have never had this problem on previous installs which used a separate X window. It only happens on KDE 4x.

Perhaps it is because KDE 4x no longer supports independent desktops but it will support a separate X window where an application can be launched (such as MythTV).

I understand there is a program called xf86-input-void that might correct this problem by providing dummy inputs in xorg.conf but that will not work for me because HAL is detecting all of my input devices instead of the xorg-server. Perhaps I need an .fdi file for HAL?

My question would be, Is there a way to gain focus once again to the second monitor once it loses focus? Could the problem be because I do not have a window manager on the second monitor such as xfce or icewm?

Thanks for any help I may get,

UPDATE :::::::::::
I reconfigured xorg.conf so that HAL would no longer operate the input devices but the problem still exists, so HAL has nothing to do with it.

Last edited by rrrssssss; 11-30-2009 at 02:38 PM.
Old 11-30-2009, 02:35 PM   #2
Registered: Mar 2005
Posts: 284

Original Poster
Rep: Reputation: 33

Hello again forum,

I solved my problem.

First, I have to have some type of window manager running such as icewm but that alone did not solve my problem.

After I launched icewm, then I had to start mythfrontend from the second monitor. I had been launching mythfrontend from my first monitor with a bash script (DISPLAY=":0.1" /usr/bin/mythfrontend &). Once I lauched mythfrontend from the second monitor instead of the first monitor, the problem was solved. Now I can click on any window in the second monitor and the focus will shift to the second monitor.

So it is imperative that whatever application you plan to run, start it in the same monitor, not another monitor. Otherwise, you will have focus problems.

I had to use icewm's terminal window to start mythfrontend in the second monitor because I am unable to drag an icon such as a bash script to icewm's desktop from the first monitor.

Does anybody know if it is possible to create an icon (such as a bash scrip) on the desktop of icewm?

Joy again,

By the way, is there some code I could add to my original bash script that would allow me to launch mythfrontend (or icewm) from the first monitor and have the focus problem resolved? Because icewm always has to be launched from the first monitor, creating a focus problem within icewm and the same rule would apply to mythfrontend also.

Last edited by rrrssssss; 12-01-2009 at 05:39 AM.
Old 12-01-2009, 05:37 AM   #3
Registered: Mar 2005
Posts: 284

Original Poster
Rep: Reputation: 33
Solved even better

I figured out a simple way to start mythfrontend from the first monitor and the focus problem be resolved. I used the following script below:

DISPLAY=":0.1" /usr/bin/icewm &
sleep 1
DISPLAY=":0.1" /usr/bin/mythfrontend &

If both commands (icewm and mythfrontend) are combined into one script instead of using two separate scripts, the focus problem is resolved. I had been using separate scripts, one script for icewm and another script for mythfrontend. That will not work. Both commands must be in the same script. Now I can start mythfrontend from my first monitor and have no focus problem.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
middle mouse click is replaced by the dual click wanas Linux - Desktop 2 05-15-2009 04:53 PM
Focus on Click or anything else besides Focus on mouse. mellor Linux - Newbie 2 05-29-2008 11:31 AM
Window focus: where is click-titlebar-to-raise? TristanDee Debian 2 01-17-2008 09:00 AM
click to focus window dynamicit SUSE / openSUSE 0 08-01-2006 10:54 AM
mouse: single-click becomes double-click kinzlaw Linux - Hardware 2 08-24-2005 07:55 PM > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 04:57 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration