Keyboard focus in 'some' wine apps (games)

Open forum for end-user questions about Wine. Before asking questions, check out the Wiki as a first step.
Forum Rules
Locked
ngoonee
Level 2
Level 2
Posts: 23
Joined: Thu Jun 10, 2010 11:35 am

Keyboard focus in 'some' wine apps (games)

Post by ngoonee »

Hi,

I've noticed, now that I'm using twinview, that when I click any other window outside of the Wine desktop (Civ4 or WCIII normally), I can click back to the Wine desktop but can no longer use any of the keyboard shortcuts. Things work fine before actually clicking outside the wine window (for example, on my Pidgin chat window).

This happens whether the app is run in windowed mode or fullscreen. Another app (e-sword) works just fine, I can type into it, switch to another app, switch back, no problem.

The first time I click away from the wine desktop, it sort of flickers and goes black for a split second, but continues rendering the game fine, no crash or anything.

This happens with compiz or metacity equally, so is reasonably WM-agnostic. I've read in some really old forums/blogs that minimizing and maximizing the window should bring focus back, but doesn't work in my case with both games.
James McKenzie

Keyboard focus in 'some' wine apps (games)

Post by James McKenzie »

ngoonee wrote:
Hi,

I've noticed, now that I'm using twinview, that when I click any other window outside of the Wine desktop (Civ4 or WCIII normally), I can click back to the Wine desktop but can no longer use any of the keyboard shortcuts. Things work fine before actually clicking outside the wine window (for example, on my Pidgin chat window).

This happens whether the app is run in windowed mode or fullscreen. Another app (e-sword) works just fine, I can type into it, switch to another app, switch back, no problem.

The first time I click away from the wine desktop, it sort of flickers and goes black for a split second, but continues rendering the game fine, no crash or anything.

This happens with compiz or metacity equally, so is reasonably WM-agnostic. I've read in some really old forums/blogs that minimizing and maximizing the window should bring focus back, but doesn't work in my case with both games.



Try it without any of the windows enhancers. There are known issues
between compiz and Wine.

James McKenzie
ngoonee
Level 2
Level 2
Posts: 23
Joined: Thu Jun 10, 2010 11:35 am

Post by ngoonee »

Hi James, thanks for the prompt reply. As I specify, this happens with or without compiz. If not for metacity, what WM is recommended?
James McKenzie

Keyboard focus in 'some' wine apps (games)

Post by James McKenzie »

ngoonee wrote:
Hi James, thanks for the prompt reply. As I specify, this happens with or without compiz. If not for metacity, what WM is recommended?

If metacity is a windows manager, then use it. I used to use either KDE
or Gnome, with a preference for the latter.

What messes up Wine is things like compiz.

James McKenzie
ngoonee
Level 2
Level 2
Posts: 23
Joined: Thu Jun 10, 2010 11:35 am

Post by ngoonee »

Hi James.

As stated in the first post, this happens even with metacity (first thing I tried).
James McKenzie

Keyboard focus in 'some' wine apps (games)

Post by James McKenzie »

ngoonee wrote:
Hi,

I've noticed, now that I'm using twinview, that when I click any other window outside of the Wine desktop (Civ4 or WCIII normally), I can click back to the Wine desktop but can no longer use any of the keyboard shortcuts. Things work fine before actually clicking outside the wine window (for example, on my Pidgin chat window).

This happens whether the app is run in windowed mode or fullscreen. Another app (e-sword) works just fine, I can type into it, switch to another app, switch back, no problem.
Interesting. Can you use any of the keyboard shortcuts (other than
Print Preview) in e-sword after switching windows? I'm certain that I
could, but I'm using a Mac....

BTW, I'm one of the maintainers of the e-sword program and would like to
solicit a review and posting in the Applications Database, after we look
well into this problem.

Also, compiz is not a windows manager, per se. It provides enhancements
that a true windows manager does not and resides on top of either KDE or
Gnome to make it 'look better'.

Can you do the following:

Run Civ4 from a terminal session with logging turned on per the FAQ item.

Switch windows.

Switch back.

Try to use a keyboard shortcut.

Advise if there are new error messages.

I realize this may be a lengthy process and you are free to post the
error log on pastebin.com or a similar site and post back the URL here.

James McKenzie
ngoonee
Level 2
Level 2
Posts: 23
Joined: Thu Jun 10, 2010 11:35 am

Re: Keyboard focus in 'some' wine apps (games)

Post by ngoonee »

James McKenzie wrote:ngoonee wrote:
Hi,

I've noticed, now that I'm using twinview, that when I click any other window outside of the Wine desktop (Civ4 or WCIII normally), I can click back to the Wine desktop but can no longer use any of the keyboard shortcuts. Things work fine before actually clicking outside the wine window (for example, on my Pidgin chat window).

This happens whether the app is run in windowed mode or fullscreen. Another app (e-sword) works just fine, I can type into it, switch to another app, switch back, no problem.
Interesting. Can you use any of the keyboard shortcuts (other than
Print Preview) in e-sword after switching windows? I'm certain that I
could, but I'm using a Mac....

BTW, I'm one of the maintainers of the e-sword program and would like to
solicit a review and posting in the Applications Database, after we look
well into this problem.
Hi James,

I just tested e-sword here, works fine (Ctrl-F1/Ctrl-F2 shortcut). I got it working (ages back) using the volumes of information available at ubuntuforums.org (tons of users trying to do that there, someone even maintains a script to automate the setup process), though I'm no longer using that distro.

Will look into the rest of the stuff later, thanks.
ngoonee
Level 2
Level 2
Posts: 23
Joined: Thu Jun 10, 2010 11:35 am

Post by ngoonee »

Tried it out (without debug logs). Nothing interesting, it looks the same with or without clicking outside the window. In this case, I click on a gedit window, subsequent keypresses are registered in the gedit window instead of in the wine window. In both logs all I do is start the game, load the same saved game, and try to use the 'g' key.

Should I do full debug logs, and which channels would be important? As stated, it doesn't seem like anything errors out, wine just loses keyboard focus and doesn't get it back. I can click and continue to play, but pressing 'g' just makes a 'g' appear in gedit.

http://pastebin.com/NF3UHhLj
James McKenzie

Keyboard focus in 'some' wine apps (games)

Post by James McKenzie »

ngoonee wrote:
Tried it out (without debug logs). Nothing interesting, it looks the same with or without clicking outside the window. In this case, I click on a gedit window, subsequent keypresses are registered in the gedit window instead of in the wine window. In both logs all I do is start the game, load the same saved game, and try to use the 'g' key.

Should I do full debug logs, and which channels would be important? As stated, it doesn't seem like anything errors out, wine just loses keyboard focus and doesn't get it back. I can click and continue to play, but pressing 'g' just makes a 'g' appear in gedit.

http://pastebin.com/NF3UHhLj
Again, does this happen with e-sword?

Also, some of the shortcut keys require a special key like ALT or CNTRL,
are these affected?

James McKenzie
James McKenzie

Keyboard focus in 'some' wine apps (games)

Post by James McKenzie »

James McKenzie wrote:
ngoonee wrote:
Tried it out (without debug logs). Nothing interesting, it looks the
same with or without clicking outside the window. In this case, I
click on a gedit window, subsequent keypresses are registered in the
gedit window instead of in the wine window. In both logs all I do is
start the game, load the same saved game, and try to use the 'g' key.

Should I do full debug logs, and which channels would be important?
As stated, it doesn't seem like anything errors out, wine just loses
keyboard focus and doesn't get it back. I can click and continue to
play, but pressing 'g' just makes a 'g' appear in gedit.

http://pastebin.com/NF3UHhLj
Again, does this happen with e-sword?

Also, some of the shortcut keys require a special key like ALT or
CNTRL, are these affected?
Answered my own question. Pasting does work (Cntrl+V) as well as other
functions. Cntrl+Fn keys are special on a Mac. I'll have to look at
them. However, typing gggggg and any other sequence of characters will
go to the current open window (I used the note area in e-Sword).

Also you might be interested in Bug 23123 which was filed against
Wine-1.2-rc2.

James McKenzie
ngoonee
Level 2
Level 2
Posts: 23
Joined: Thu Jun 10, 2010 11:35 am

Re: Keyboard focus in 'some' wine apps (games)

Post by ngoonee »

James McKenzie wrote:James McKenzie wrote:
ngoonee wrote:
Tried it out (without debug logs). Nothing interesting, it looks the
same with or without clicking outside the window. In this case, I
click on a gedit window, subsequent keypresses are registered in the
gedit window instead of in the wine window. In both logs all I do is
start the game, load the same saved game, and try to use the 'g' key.

Should I do full debug logs, and which channels would be important?
As stated, it doesn't seem like anything errors out, wine just loses
keyboard focus and doesn't get it back. I can click and continue to
play, but pressing 'g' just makes a 'g' appear in gedit.

http://pastebin.com/NF3UHhLj
Again, does this happen with e-sword?

Also, some of the shortcut keys require a special key like ALT or
CNTRL, are these affected?
Answered my own question. Pasting does work (Cntrl+V) as well as other
functions. Cntrl+Fn keys are special on a Mac. I'll have to look at
them. However, typing gggggg and any other sequence of characters will
go to the current open window (I used the note area in e-Sword).

Also you might be interested in Bug 23123 which was filed against
Wine-1.2-rc2.

James McKenzie
Appreciate your assistance on this. e-Sword does work in my case, in that clicking on the note area allows me to type into the note area (focus regained by wine).

Checked out the bug, did not seem to apply. I'm running 1.2-rc3, should the reversion have taken place for that? Also the behaviour I'm describing didn't start with 1.2, happened with 1.1.23 onwards at least (perhaps before but I wasn't using it then yet.
James McKenzie

Keyboard focus in 'some' wine apps (games)

Post by James McKenzie »

ngoonee wrote:
James McKenzie wrote:
James McKenzie wrote:

ngoonee wrote:

Again, does this happen with e-sword?

Also, some of the shortcut keys require a special key like ALT or
CNTRL, are these affected?


Answered my own question. Pasting does work (Cntrl+V) as well as other
functions. Cntrl+Fn keys are special on a Mac. I'll have to look at
them. However, typing gggggg and any other sequence of characters will
go to the current open window (I used the note area in e-Sword).

Also you might be interested in Bug 23123 which was filed against
Wine-1.2-rc2.

James McKenzie
Appreciate your assistance on this. e-Sword does work in my case, in that clicking on the note area allows me to type into the note area (focus regained by wine).

Checked out the bug, did not seem to apply. I'm running 1.2-rc3, should the reversion have taken place for that? Also the behaviour I'm describing didn't start with 1.2, happened with 1.1.23 onwards at least (perhaps before but I wasn't using it then yet.

Hmmm. Unfortunately, this calls for a regression test between 1.1.22
and 1.1.23 to discover which change to Wine's code caused the problem.
I would file a bug report (I could not find any like this one) and if
possible run a regression test and attach results to the bug report.

I wish I had a better answer than this.

James McKenzie
ngoonee
Level 2
Level 2
Posts: 23
Joined: Thu Jun 10, 2010 11:35 am

Re: Keyboard focus in 'some' wine apps (games)

Post by ngoonee »

James McKenzie wrote:Hmmm. Unfortunately, this calls for a regression test between 1.1.22
and 1.1.23 to discover which change to Wine's code caused the problem.
I would file a bug report (I could not find any like this one) and if
possible run a regression test and attach results to the bug report.

I wish I had a better answer than this.

James McKenzie
Doubt it'd be a worthwhile idea, since I cannot confirm that the same issue does not occur on 1.1.22. The week's started, once I find time I'll try and do tests to see if earlier versions of wine exhibit the same/different behaviour, so there's a proper 'this started happening here' answer.
James McKenzie

Keyboard focus in 'some' wine apps (games)

Post by James McKenzie »

ngoonee wrote:
James McKenzie wrote:
Hmmm. Unfortunately, this calls for a regression test between 1.1.22
and 1.1.23 to discover which change to Wine's code caused the problem.
I would file a bug report (I could not find any like this one) and if
possible run a regression test and attach results to the bug report.

I wish I had a better answer than this.

James McKenzie
Doubt it'd be a worthwhile idea, since I cannot confirm that the same issue does not occur on 1.1.22. The week's started, once I find time I'll try and do tests to see if earlier versions of wine exhibit the same/different behaviour, so there's a proper 'this started happening here' answer.

Thank you. If you do find the problem, please review Wine's bugzilla
(there may already be a report for this) and either file a new bug
report or vote on the existing one.

James McKenzie
ngoonee
Level 2
Level 2
Posts: 23
Joined: Thu Jun 10, 2010 11:35 am

Post by ngoonee »

A start, wine-stable works fine (with regards to this specific issue). Unfortunately I'm having a bit of a tough time compiling older versions of wine, since my distro has the latest of basically everything, including gcc (which as I understand it breaks older wine compilation). Will try and find a roll-back repo.
ngoonee
Level 2
Level 2
Posts: 23
Joined: Thu Jun 10, 2010 11:35 am

Post by ngoonee »

Damn it, I found out what the issue was. After trying various newer and newer packages of wine for my distro (Arch) I realized all of them worked... then I remembered that my 'standard' wine package which I was using all the while had patches for WC, including one which dealt with keyboard focus....

Anyway, my bad. Vanilla wine does not display this issue for me (though it also does not allow for WC3 hosting, but one thing at a time). Sorry to waste your time James.
James McKenzie

Keyboard focus in 'some' wine apps (games)

Post by James McKenzie »

ngoonee wrote:
Damn it, I found out what the issue was. After trying various newer and newer packages of wine for my distro (Arch) I realized all of them worked... then I remembered that my 'standard' wine package which I was using all the while had patches for WC, including one which dealt with keyboard focus....

Anyway, my bad. Vanilla wine does not display this issue for me (though it also does not allow for WC3 hosting, but one thing at a time). Sorry to waste your time James.

Not a waste of time. However, this is why we recommend NOT using
'hacks' as they can cause (and in your case did cause) problems.

If you need to use the hack, then I recommend putting your special build
in a different place than a prebuild Wine (it installs in /usr or
/usr/local).

And have a good time playing. Let us know if you have any other
problems with Wine.

James McKenzie
Locked