Thread: BBC Micro
View Single Post
lcuk's Avatar
Posts: 1,635 | Thanked: 1,816 times | Joined on Apr 2008 @ Manchester, England
#21
Originally Posted by marnanel View Post
When an app refuses focus, the focus ends up on the desktop. When a keypress is received by the desktop, this is interpreted as a request to look up contacts beginning with that letter.
yes


I would be a whole lot happier if applications did not attempt to mess with focus and left this to the window manager. That's what we have a window manager for. The ICCCM actually forbids you to do this unilaterally (4.2.7); you're also not supposed to be using RevertToPointerRoot or CurrentTime (see the footnotes of 4.2.7).
cool, i see.
so the workaround as suggested to me originally is due to a generic problem that has been there all along in fremantle, but was obviously handled differently by the n8x0 window manager?



I'm not sure why you think I didn't explain the problem, since I went into some detail here.

To recap:
  • A window can have a field called WM_HINTS.
  • One of the bits in this field is called InputHint.
  • If this bit is not set, the window is saying that it never wants input focus. If the window manager was to give such a window focus, the window manager would be broken.
  • libsdl contains a bug which clears this bit if you set an icon on your window.
  • Therefore, if you set an icon on an SDL window, the window manager will never give that window focus.
  • This is correct behaviour on the part of the window manager.
  • On the other hand, if you don't set an icon on the window, it doesn't matter, because Maemo is clever and will get the icon from elsewhere.
  • Therefore, not setting an icon is a perfect workaround until the libsdl bug is fixed.
yes, but the same code in liqbase runs perfectly on diablo, i gather likewise for yourself the code seem to work properly for SDL on diablo too?


I don't know whether your program is suffering from a similar bug, but I can check if you like. Or you can check, if you want, by running xprop against your toplevel window.
thanks

the version in extras-devel is unstable atm, its just waiting for me to push some updates after a short trip, but since you know what you are looking for, if you identify the patch point, I would be most appreciative.
if it can be solved in a similar way to your fix - ie once for the entire app run, it will hopefully cure the other secondary liqbase problem where the symptoms of no text input return after minimizing.

i'm sorry i didnt see the reasoning beforehand, i just saw the same symptoms and knew a fairly simple workaround existed.
__________________
liqbase sketching the future.
like what i say? hit the Thanks, thanks!
twitter.com/lcuk