Hi! I'm having a problem when ctwm's SloppyFocus is enabled. The window created by the attached example C program never gets focus, even when the mouse pointer enters it. The window is created using the Xlib function XCreateSimpleWindow. Both twm and Mwm focus this window when it is entered by the pointer.
I have seen at least one other program having this issue under ctwm, that is `sunclock' ( see: http://directory.fsf.org/wiki/Sunclock ) This behaviour has been observed both on ctwm 3.8.1 and 3.8.2. Thanks for your time. Regards, DN -- Dario Niedermann. Also on the Internet at: gopher://retro-net.org/1/dnied/ , http://devio.us/~ndr/ ---- Cut Here and feed the following to sh ---- #!/bin/sh # This is a shell archive (produced by GNU sharutils 4.11). # To extract the files from this archive, save it to some FILE, remove # everything before the `#!/bin/sh' line above, then type `sh FILE'. # lock_dir=_sh12167 # Made on 2015-06-22 10:02 CEST by <[email protected]>. # Source directory was `/home/ndr/doc/comp/prg/xlib-tut'. # # Existing files will *not* be overwritten, unless `-c' is specified. # # This shar contains: # length mode name # ------ ---------- ------------------------------------------ # 1646 -rw------- ctwmtest.c # if test "X$1" = "X-c" then keep_file='' else keep_file=true fi echo=echo shar_tty= shar_n= shar_c='\n' if test ! -d ${lock_dir} ; then : else ${echo} "lock directory ${lock_dir} exists" exit 1 fi if mkdir ${lock_dir} ; then : else ${echo} "failed to create ${lock_dir} lock directory" exit 1 fi # ============= ctwmtest.c ============== if test -n "${keep_file}" && test -f 'ctwmtest.c' then ${echo} "x - SKIPPING ctwmtest.c (file already exists)" else ${echo} "x - extracting ctwmtest.c (text)" sed 's/^X//' << 'SHAR_EOF' > 'ctwmtest.c' && X// ctwmtest.c - Written by Dario Niedermann <[email protected]> X// X// If SloppyFocus is enabled, ctwm never gives focus to my window X// Quit me by clicking in the window X// compile me with: 'cc -lX11 -o ctwmtest ctwmtest.c' X X#include <stdlib.h> X#include <stdio.h> X#include <X11/Xlib.h> X#include <assert.h> X Xint main() X{ X Display *disp; Window rootwin, mywin; XEvent an_event; X X int scr_num, scr_width, scr_height, mywin_x = 0, mywin_y = 0; X unsigned int mywin_width = 320, mywin_height = 200, X mywin_border_width = 0; X unsigned long border, background; X X disp = XOpenDisplay(":0"); assert(disp != NULL); X X scr_num = DefaultScreen(disp); X rootwin = RootWindow(disp, scr_num); X X mywin = XCreateSimpleWindow(disp, rootwin, mywin_x, mywin_y, X mywin_width, mywin_height, X mywin_border_width, X BlackPixel(disp, scr_num), X WhitePixel(disp, scr_num)); X XMapWindow(disp, mywin); X XSelectInput(disp, mywin, ButtonPressMask); X X while (1) { X XNextEvent(disp, &an_event); X switch(an_event.type) { X case ButtonPress: X XCloseDisplay(disp); X return 0; X X default: X // unknown event -- ignore: X break; X } X } X} SHAR_EOF : if test $? -ne 0 then ${echo} "restore of ctwmtest.c failed" fi fi if rm -fr ${lock_dir} then ${echo} "x - removed lock directory ${lock_dir}." else ${echo} "x - failed to remove lock directory ${lock_dir}." exit 1 fi exit 0
