comparison lib/OverConv.c @ 3:e55ccba56891

imported patch 05_kinput2-v3.1-wm_state_above.patch
author Yoshiki Yazawa <yaz@honeyplanet.jp>
date Mon, 08 Mar 2010 20:07:06 +0900
parents 92745d501b9a
children 5b1d5c19f325
comparison
equal deleted inserted replaced
2:115737ec0041 3:e55ccba56891
22 #include <X11/StringDefs.h> 22 #include <X11/StringDefs.h>
23 #include <X11/Xmu/CharSet.h> 23 #include <X11/Xmu/CharSet.h>
24 #if XtSpecificationRelease > 4 24 #if XtSpecificationRelease > 4
25 #include <X11/Xfuncs.h> 25 #include <X11/Xfuncs.h>
26 #endif 26 #endif
27 #include <X11/Xatom.h>
27 #include "CachedAtom.h" 28 #include "CachedAtom.h"
28 #include "AsyncErr.h" 29 #include "AsyncErr.h"
29 #include "OverConvP.h" 30 #include "OverConvP.h"
30 #include "InputConv.h" 31 #include "InputConv.h"
31 #include "ConvDisp.h" 32 #include "ConvDisp.h"
1276 SelectionStart(ocw, kind) 1277 SelectionStart(ocw, kind)
1277 OverTheSpotConversionWidget ocw; 1278 OverTheSpotConversionWidget ocw;
1278 int kind; 1279 int kind;
1279 { 1280 {
1280 Cardinal ncand; 1281 Cardinal ncand;
1282 Atom wm_state, atom;
1283 unsigned long data[2];
1284 Display *dpy;
1281 1285
1282 TRACE(("OverTheSpotConversion:SelectionStart()\n")); 1286 TRACE(("OverTheSpotConversion:SelectionStart()\n"));
1283 if (ocw->overthespot.selectionpoppedup) { 1287 if (ocw->overthespot.selectionpoppedup) {
1284 DPRINT(("\tselection already started -- ignored\n")); 1288 DPRINT(("\tselection already started -- ignored\n"));
1285 return; 1289 return;
1294 ocw->overthespot.numcands, 0, True); 1298 ocw->overthespot.numcands, 0, True);
1295 1299
1296 locateSelectionPopup(ocw); 1300 locateSelectionPopup(ocw);
1297 XtPopup(ocw->overthespot.selectionshell, XtGrabNone); 1301 XtPopup(ocw->overthespot.selectionshell, XtGrabNone);
1298 ocw->overthespot.selectionpoppedup = True; 1302 ocw->overthespot.selectionpoppedup = True;
1303 /* force to be set _NET_WM_STATE_ABOVE, because the candidate window
1304 * always should be shown above anything window.
1305 */
1306 dpy = XtDisplay ((Widget) ocw);
1307 wm_state = CachedInternAtom (dpy, "_NET_WM_STATE", True);
1308 atom = CachedInternAtom (dpy, "_NET_WM_STATE_ABOVE", True);
1309 data[0] = atom;
1310 XChangeProperty (dpy, XtWindow (ocw->overthespot.selectionshell), wm_state, XA_ATOM, 32, PropModeAppend, data, 1);
1299 } 1311 }
1300 1312
1301 /*- locateSelectionPopup: put selection popup at an appropriate position -*/ 1313 /*- locateSelectionPopup: put selection popup at an appropriate position -*/
1302 static void 1314 static void
1303 locateSelectionPopup(ocw) 1315 locateSelectionPopup(ocw)