From: Frank K. <fmf...@mi...> - 2007-03-15 14:55:43
|
Thank you for your information, Elias. I will tell you the final results of my research on what I needed to do in order to get my program to work exactly the same on Linux as it did on Windows. 1. I did some research on why the XRaiseWindow wasn't bringing the Window to the Foreground as I expected it to do. I found out that it WAS the Focus stealing prevention option within KDE that I had to turn off. I did this with the following Procedure: A. Click on KDE B. Click on Control Center C. Click on Desktop D. Click on Window behavior E. Click on Advanced Tab F. Change "Focus stealing prevention level" from "Low" to "None" G. Click on Apply 2. After this was done, the Allegro screen would go into the Foreground when XRaiseWindow was issued. 3. The only problem was that the Focus was still on another Screen. In order to put the Focus onto the new Foreground screen I had to add the following command after the XRaiseWindow call: XSetInputFocus(_xwin.display, _xwin.window, RevertToNone, CurrentTime); 4. It then ran Perfect, the exact same way as under Windows. I hope this might be of some use to anyone who wants to do the functional equivalent of the SetForegroundWindow command from Windows on a Linux system. Thank you again very much for your help. Frank Krauss ================================================================ on Monday 12 March 2007 08:36 am, Elias Pschernig wrote: > On Mon, 2007-03-12 at 09:10 -0500, Frank Krauss wrote: > > Thank you for your fast response, Elias. > > > > I will tell you the results of my testing your recomendation. > > > > When I put your idea of XRaiseWindow in my progrem > > I got an error due to the fact of "wm_window" not being defined in > > _win_type. I noticed that was correct but there was a "window" defined in > > that structure. I changed it to use "window" and it ran just the way you > > said it would. > > Yes, the window handling was changed at one point to fix switching > between fullscreen and windowed modes, so now "window" is only a > sub-window of "wm_window" (which is the top-level X11 window). Likely > when you update to the latest version of Allegro, you will need to be > aware of this. > > > It caused the Window name to flash in the task-bar but it > > didn't > > case the Allegro window to be activated in the Foreground as I wanted. > > > > While doing some research on XRaiseWindow in Google I came across > > mentions that a KDE option called "Focus Stealing Prevention" may be the > > cause of my problem and that if I can Disable this option, I s/b able to > > do what I wish. > > > > I will therefore have to get in touch with the KDE people to ask them > > how to disable this option. > > Yes, likely at least the user (if not your program) will be able to > change it. Actually, I thought also XP has this focus stealing > prevention, I needed to mess with this for AllegroGL (which destroys the > Allegro window and creates a new window, which often would end up not > having focus at first..). Thinking about it, even the window->wm_window > change mentioned above might have been related to this. > > -- > Elias Pschernig > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share > your opinions on IT & business topics through brief surveys-and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV |