Mercurial > kinput2.yaz
changeset 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 | 115737ec0041 |
children | 5b1d5c19f325 |
files | lib/OffConv.c lib/OnConv.c lib/OverConv.c |
diffstat | 3 files changed, 36 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/lib/OffConv.c Mon Mar 08 20:07:05 2010 +0900 +++ b/lib/OffConv.c Mon Mar 08 20:07:06 2010 +0900 @@ -28,6 +28,7 @@ #if XtSpecificationRelease > 4 #include <X11/Xfuncs.h> #endif +#include <X11/Xatom.h> #include "CachedAtom.h" #include "AsyncErr.h" #include "OffConvP.h" @@ -1069,6 +1070,9 @@ int kind; { Cardinal ncand; + Atom wm_state, atom; + unsigned long data[2]; + Display *dpy; TRACE(("OffTheSpotConversion:SelectionStart()\n")); if (ocw->offthespot.selectionpoppedup) { @@ -1089,6 +1093,14 @@ XtPopup(ocw->offthespot.selectionshell, XtGrabNone); ocw->offthespot.selectionpoppedup = True; + /* force to be set _NET_WM_STATE_ABOVE, because the candidate window + * always should be shown above anything window. + */ + dpy = XtDisplay ((Widget) ocw); + wm_state = CachedInternAtom (dpy, "_NET_WM_STATE", True); + atom = CachedInternAtom (dpy, "_NET_WM_STATE_ABOVE", True); + data[0] = atom; + XChangeProperty (dpy, XtWindow (ocw->offthespot.selectionshell), wm_state, XA_ATOM, 32, PropModeAppend, data, 1); } static void
--- a/lib/OnConv.c Mon Mar 08 20:07:05 2010 +0900 +++ b/lib/OnConv.c Mon Mar 08 20:07:06 2010 +0900 @@ -27,6 +27,7 @@ #if XtSpecificationRelease > 4 #include <X11/Xfuncs.h> #endif +#include <X11/Xatom.h> #include "CachedAtom.h" #include "AsyncErr.h" #include "OnConvP.h" @@ -761,6 +762,9 @@ int kind; { Cardinal ncand; + Atom wm_state, atom; + unsigned long data[2]; + Display *dpy; TRACE(("OnTheSpotConversion:SelectionStart()\n")); if (ocw->onthespot.selectionpoppedup) { @@ -779,6 +783,14 @@ LocateSelectionPopup(ocw); XtPopup(ocw->onthespot.selectionshell, XtGrabNone); ocw->onthespot.selectionpoppedup = True; + /* force to be set _NET_WM_STATE_ABOVE, because the candidate window + * always should be shown above anything window. + */ + dpy = XtDisplay ((Widget) ocw); + wm_state = CachedInternAtom (dpy, "_NET_WM_STATE", True); + atom = CachedInternAtom (dpy, "_NET_WM_STATE_ABOVE", True); + data[0] = atom; + XChangeProperty (dpy, XtWindow (ocw->onthespot.selectionshell), wm_state, XA_ATOM, 32, PropModeAppend, data, 1); } /*- LocateSelectionPopup: put selection popup at an appropriate position -*/
--- a/lib/OverConv.c Mon Mar 08 20:07:05 2010 +0900 +++ b/lib/OverConv.c Mon Mar 08 20:07:06 2010 +0900 @@ -24,6 +24,7 @@ #if XtSpecificationRelease > 4 #include <X11/Xfuncs.h> #endif +#include <X11/Xatom.h> #include "CachedAtom.h" #include "AsyncErr.h" #include "OverConvP.h" @@ -1278,6 +1279,9 @@ int kind; { Cardinal ncand; + Atom wm_state, atom; + unsigned long data[2]; + Display *dpy; TRACE(("OverTheSpotConversion:SelectionStart()\n")); if (ocw->overthespot.selectionpoppedup) { @@ -1296,6 +1300,14 @@ locateSelectionPopup(ocw); XtPopup(ocw->overthespot.selectionshell, XtGrabNone); ocw->overthespot.selectionpoppedup = True; + /* force to be set _NET_WM_STATE_ABOVE, because the candidate window + * always should be shown above anything window. + */ + dpy = XtDisplay ((Widget) ocw); + wm_state = CachedInternAtom (dpy, "_NET_WM_STATE", True); + atom = CachedInternAtom (dpy, "_NET_WM_STATE_ABOVE", True); + data[0] = atom; + XChangeProperty (dpy, XtWindow (ocw->overthespot.selectionshell), wm_state, XA_ATOM, 32, PropModeAppend, data, 1); } /*- locateSelectionPopup: put selection popup at an appropriate position -*/