Mercurial > kinput2.yaz
comparison lib/OnConv.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 |
---|---|
25 #include <X11/StringDefs.h> | 25 #include <X11/StringDefs.h> |
26 #include <X11/Xmu/Atoms.h> | 26 #include <X11/Xmu/Atoms.h> |
27 #if XtSpecificationRelease > 4 | 27 #if XtSpecificationRelease > 4 |
28 #include <X11/Xfuncs.h> | 28 #include <X11/Xfuncs.h> |
29 #endif | 29 #endif |
30 #include <X11/Xatom.h> | |
30 #include "CachedAtom.h" | 31 #include "CachedAtom.h" |
31 #include "AsyncErr.h" | 32 #include "AsyncErr.h" |
32 #include "OnConvP.h" | 33 #include "OnConvP.h" |
33 #include "InputConv.h" | 34 #include "InputConv.h" |
34 #include "ConvDisp.h" | 35 #include "ConvDisp.h" |
759 SelectionStart(ocw, kind) | 760 SelectionStart(ocw, kind) |
760 OnTheSpotConversionWidget ocw; | 761 OnTheSpotConversionWidget ocw; |
761 int kind; | 762 int kind; |
762 { | 763 { |
763 Cardinal ncand; | 764 Cardinal ncand; |
765 Atom wm_state, atom; | |
766 unsigned long data[2]; | |
767 Display *dpy; | |
764 | 768 |
765 TRACE(("OnTheSpotConversion:SelectionStart()\n")); | 769 TRACE(("OnTheSpotConversion:SelectionStart()\n")); |
766 if (ocw->onthespot.selectionpoppedup) { | 770 if (ocw->onthespot.selectionpoppedup) { |
767 TRACE(("\tselection already started -- ignored\n")); | 771 TRACE(("\tselection already started -- ignored\n")); |
768 return; | 772 return; |
777 ocw->onthespot.numcands, 0, True); | 781 ocw->onthespot.numcands, 0, True); |
778 | 782 |
779 LocateSelectionPopup(ocw); | 783 LocateSelectionPopup(ocw); |
780 XtPopup(ocw->onthespot.selectionshell, XtGrabNone); | 784 XtPopup(ocw->onthespot.selectionshell, XtGrabNone); |
781 ocw->onthespot.selectionpoppedup = True; | 785 ocw->onthespot.selectionpoppedup = True; |
786 /* force to be set _NET_WM_STATE_ABOVE, because the candidate window | |
787 * always should be shown above anything window. | |
788 */ | |
789 dpy = XtDisplay ((Widget) ocw); | |
790 wm_state = CachedInternAtom (dpy, "_NET_WM_STATE", True); | |
791 atom = CachedInternAtom (dpy, "_NET_WM_STATE_ABOVE", True); | |
792 data[0] = atom; | |
793 XChangeProperty (dpy, XtWindow (ocw->onthespot.selectionshell), wm_state, XA_ATOM, 32, PropModeAppend, data, 1); | |
782 } | 794 } |
783 | 795 |
784 /*- LocateSelectionPopup: put selection popup at an appropriate position -*/ | 796 /*- LocateSelectionPopup: put selection popup at an appropriate position -*/ |
785 static void | 797 static void |
786 LocateSelectionPopup(ocw) | 798 LocateSelectionPopup(ocw) |