# HG changeset patch # User Yoshiki Yazawa # Date 1268048297 -32400 # Node ID 07a41a882b14ab7d87c31c7ea9b243af3a120bfb # Parent 688ac5040e7da72db2c35baf8e25b1581a7c0541 imported patch 21_kinput2-v3.1-rootwindow-1.patch diff -r 688ac5040e7d -r 07a41a882b14 lib/OffConv.c --- a/lib/OffConv.c Mon Mar 08 20:38:17 2010 +0900 +++ b/lib/OffConv.c Mon Mar 08 20:38:17 2010 +0900 @@ -44,6 +44,14 @@ #define DEBUG_VAR debug_OffTheSpotConversion #include "DebugPrint.h" +#define CloseWindowProtection(w) \ + {\ + Atom protocols;\ + protocols = XInternAtom(XtDisplay(w), "WM_DELETE_WINDOW", False);\ + XSetWMProtocols(XtDisplay(w), XtWindow(w), &protocols, 1);\ + } + + /*- resource table for OffTheSpotConversion (SeparateConversion has no resources -*/ static XtResource off_resources[] = { #define offset(field) XtOffset(OffTheSpotConversionWidget, offthespot.field) @@ -619,6 +627,7 @@ /* ポップアップする */ XtPopup(widget, XtGrabNone); + CloseWindowProtection(widget); } /*- Separate_ConversionFinish: Separate conversion finish -*/ @@ -1024,6 +1033,7 @@ XtVaSetValues(ocw->offthespot.modewidget, XtNlabel, ICGetMode(ocw->ccontrol.inputobj), NULL); + TRACE(("OffTheSpotConversion:UpdateMode():end\n")); } static void @@ -1088,6 +1098,7 @@ LocateSelectionPopup(ocw); XtPopup(ocw->offthespot.selectionshell, XtGrabNone); + CloseWindowProtection(ocw->offthespot.selectionshell); ocw->offthespot.selectionpoppedup = True; } @@ -1253,6 +1264,7 @@ LocateAuxPopup(ocw); XtPopup(ocw->offthespot.auxshell, XtGrabNone); + CloseWindowProtection(ocw->offthespot.auxshell); ocw->offthespot.auxpoppedup = True; } diff -r 688ac5040e7d -r 07a41a882b14 lib/OnConv.c --- a/lib/OnConv.c Mon Mar 08 20:38:17 2010 +0900 +++ b/lib/OnConv.c Mon Mar 08 20:38:17 2010 +0900 @@ -39,6 +39,14 @@ #define DEBUG_VAR debug_OnTheSpotConversion #include "DebugPrint.h" +#define CloseWindowProtection(w) \ + {\ + Atom protocols;\ + protocols = XInternAtom(XtDisplay(w), "WM_DELETE_WINDOW", False);\ + XSetWMProtocols(XtDisplay(w), XtWindow(w), &protocols, 1);\ + } + + /*- resource table -*/ static XtResource resources[] = { #define offset(field) XtOffset(OnTheSpotConversionWidget, onthespot.field) @@ -778,6 +786,7 @@ LocateSelectionPopup(ocw); XtPopup(ocw->onthespot.selectionshell, XtGrabNone); + CloseWindowProtection(ocw->onthespot.selectionshell); ocw->onthespot.selectionpoppedup = True; } @@ -952,6 +961,7 @@ LocateAuxPopup(ocw); XtPopup(ocw->onthespot.auxshell, XtGrabNone); + CloseWindowProtection(ocw->onthespot.auxshell); ocw->onthespot.auxpoppedup = True; } diff -r 688ac5040e7d -r 07a41a882b14 lib/OverConv.c --- a/lib/OverConv.c Mon Mar 08 20:38:17 2010 +0900 +++ b/lib/OverConv.c Mon Mar 08 20:38:17 2010 +0900 @@ -37,6 +37,13 @@ #define DEBUG_VAR debug_OverTheSpotConversion #include "DebugPrint.h" +#define CloseWindowProtection(w) \ + {\ + Atom protocols;\ + protocols = XInternAtom(XtDisplay(w), "WM_DELETE_WINDOW", False);\ + XSetWMProtocols(XtDisplay(w), XtWindow(w), &protocols, 1);\ + } + typedef enum { NeedNone, NeedRedraw, NeedReconfig } ResetStatus; /*- resource table -*/ @@ -1295,6 +1302,7 @@ locateSelectionPopup(ocw); XtPopup(ocw->overthespot.selectionshell, XtGrabNone); + CloseWindowProtection(ocw->overthespot.selectionshell); ocw->overthespot.selectionpoppedup = True; } @@ -1504,6 +1512,7 @@ locateAuxPopup(ocw, False); XtPopup(ocw->overthespot.auxshell, XtGrabNone); + CloseWindowProtection(ocw->overthespot.auxshell) ocw->overthespot.auxpoppedup = True; }