LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   [SOLVED] When second monitor loses focus, mouse click won't bring it back again (https://www.linuxquestions.org/questions/linux-desktop-74/%5Bsolved%5D-when-second-monitor-loses-focus-mouse-click-wont-bring-it-back-again-772277/)

rrrssssss 11-29-2009 11:24 AM

[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,
Roy


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.

rrrssssss 11-30-2009 02:35 PM

Solved
 
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,
Roy

PS
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.

rrrssssss 12-01-2009 05:37 AM

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:

#!/bin/bash
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.


All times are GMT -5. The time now is 07:03 AM.