@@ -1410,6 +1410,7 @@ static void process_xevent_message(Ghandles * g, XClientMessageEvent * ev)
14101410 Window w ;
14111411 int ret ;
14121412 struct msg_hdr hdr ;
1413+ struct msg_configure conf ;
14131414 Atom act_type ;
14141415 int act_fmt ;
14151416 int mapwindow = 0 ;
@@ -1442,7 +1443,7 @@ static void process_xevent_message(Ghandles * g, XClientMessageEvent * ev)
14421443 fprintf (stderr , "window 0x%lx havn't proper _XEMBED_INFO property, assuming defaults (workaround for buggy applications)\n" , w );
14431444 }
14441445 if (act_type == g -> xembed_info && nitems == 2 ) {
1445- mapwindow = ((int * )data )[1 ] & XEMBED_MAPPED ;
1446+ mapwindow = ((unsigned long * )data )[1 ] & XEMBED_MAPPED ;
14461447 /* TODO: handle version */
14471448 }
14481449 if (ret == Success && nitems > 0 )
@@ -1486,18 +1487,27 @@ static void process_xevent_message(Ghandles * g, XClientMessageEvent * ev)
14861487 resp .data .l [4 ] = 0 ; /* TODO: handle version; GTK+ uses version 1, but spec says the latest is 0 */
14871488 resp .display = g -> display ;
14881489 XSendEvent (resp .display , resp .window , False ,
1489- NoEventMask , (XEvent * ) & ev );
1490+ NoEventMask , (XEvent * ) & resp );
14901491 XRaiseWindow (g -> display , w );
14911492 if (mapwindow )
14921493 XMapRaised (g -> display , resp .window );
14931494 XMapWindow (g -> display , wd -> embeder );
14941495 XLowerWindow (g -> display , wd -> embeder );
1495- XMoveWindow (g -> display , w , 0 , 0 );
1496+ XMoveResizeWindow (g -> display , w , 0 , 0 , 32 , 32 );
14961497 /* force refresh of window content */
14971498 XClearWindow (g -> display , wd -> embeder );
14981499 XClearArea (g -> display , w , 0 , 0 , 32 , 32 , True ); /* XXX defult size once again */
14991500 XSync (g -> display , False );
15001501
1502+ hdr .type = MSG_CONFIGURE ;
1503+ hdr .window = w ;
1504+ conf .x = 0 ;
1505+ conf .y = 0 ;
1506+ conf .width = 32 ;
1507+ conf .height = 32 ;
1508+ conf .override_redirect = 0 ;
1509+ write_message (g -> vchan , hdr , conf );
1510+
15011511 hdr .type = MSG_DOCK ;
15021512 hdr .window = w ;
15031513 hdr .untrusted_len = 0 ;
0 commit comments