On Mon, Jun 22, 2015 at 10:26:33AM +0200 I heard the voice of
Dario Niedermann, and lo! it spake thus:
>
> Hi! I'm having a problem when ctwm's SloppyFocus is enabled.
It's a bit broader than just SloppyFocus. For instance, without it,
try focusing the window via the icon manager.
This is occuring because the window never sets any WM_HINTS, and as a
result, it doesn't get set to accept input, and so a lot of
focus-setting just never gets run on it. So, at first blush, it
sounds like an application bug, in that it never asks the window
manager to give it focus.
Now, maybe we should assume windows that don't tell us anything want
focus? I dunno, that seems a little rash. That requirement goes
_way_ back, to at least 3.1p3, which was in something like 1994...
With this tweak to the ctwmtest.c, it all appears to work fine:
--- ctwmtest.c.orig 2015-06-24 21:50:35.601682000 -0500
+++ ctwmtest.c 2015-06-24 21:52:51.349445000 -0500
@@ -7,11 +7,13 @@
#include <stdlib.h>
#include <stdio.h>
#include <X11/Xlib.h>
+#include <X11/Xutil.h>
#include <assert.h>
int main()
{
Display *disp; Window rootwin, mywin; XEvent an_event;
+ XWMHints *wmhints;
int scr_num, scr_width, scr_height, mywin_x = 0, mywin_y = 0;
unsigned int mywin_width = 320, mywin_height = 200,
@@ -31,6 +33,9 @@
WhitePixel(disp, scr_num));
XMapWindow(disp, mywin);
XSelectInput(disp, mywin, ButtonPressMask);
+ wmhints = XAllocWMHints(); assert(wmhints != NULL);
+ wmhints->input = True;
+ XSetWMHints(disp, mywin, wmhints);
while (1) {
XNextEvent(disp, &an_event);
--
Matthew Fuller (MF4839) | [email protected]
Systems/Network Administrator | http://www.over-yonder.net/~fullermd/
On the Internet, nobody can hear you scream.