Here’s a quick summary of the problem I’m having:
I’m trying to use a transparent widget in front of my application to detect all button-press events. I want to use this information to control a screensaver and to automatically log users out of my application. (I’m not running pwm on the target.) Unfortunately, every time the application creates a pop-up window, the window appears in front of the transparent widget.
Previously, firstname.lastname@example.org wrote in qdn.public.qnx4.photon:
Pete DiMarco <> peted.NOSPAM@nospam.ifsreg.com> > wrote:
: Previously, Markus Loffler wrote in qdn.public.qnx4.photon:
:> So if I understand correctly, you have a big invisible PtBasic widget that
:> convers the whole window, so it will recognize all clicks in your window.
:> > It almost works. The problem is that when the user brings up a PtWindow
:> (belonging to the application),
:> So why don’t you do the same for this PtWindow (using a PtBasic)
: Because I have over 22 pop-up windows in the application.
: It would be a real hassle to modify them all.
My first thought was I have done this with a PtRegion widget and it worked
fine. I then realised in the particular application I am thinking about,
we were not running a window manager. pwm may very well mess with the
ordering or the regions. I wouldn’t have thought so, but since you are
already making your region right behind the device region, it appears to
be the problem.
I’ve finally gotten around to changing my screensaver/login timeout code. I’m now using a transparent PtRegion to detect button events. Unfortunately, I’m still having problems with pop-up windows. Here’s my code:
PtSetArg( &args[nargs++], Pt_ARG_AREA, &area, 0 );
PtSetArg( &args[nargs++], Pt_ARG_FILL_COLOR, Pg_TRANSPARENT, 0 );
PtSetArg( &args[nargs++], Pt_ARG_REGION_PARENT, 0, 0 );
PtSetArg( &args[nargs++], Pt_ARG_REGION_INPUT_GROUP,
cbinfo->event->input_group, 0 );
PtSetArg( &args[nargs++], Pt_ARG_REGION_SENSE, ~0,
Ph_EV_BUT_PRESS | Ph_EV_BUT_RELEASE );
PtSetArg( &args[nargs++], Pt_ARG_REGION_INFRONT, Ph_DEV_RID, 0 );
PtSetArg( &args[nargs++], Pt_ARG_REGION_FLAGS, ~0, Ph_FORCE_FRONT );
PtSetArg( &args[nargs++], Pt_ARG_REGION_OPAQUE, ~0,
Ph_EV_PTR_ALL | Ph_EV_EXPOSE );
PtSetArg( &args[nargs++], Pt_ARG_REGION_FIELDS, ~0,
Ph_REGION_ORIGIN | Ph_REGION_RECT | Ph_REGION_EV_SENSE
| Ph_REGION_EV_OPAQUE | Ph_REGION_PARENT | Ph_REGION_FLAGS );
PtSetParentWidget( NULL );
Base_Region_Wgt= PtCreateWidget( PtRegion, NULL, nargs, args );
PtSetParentWidget( ABW_base );
PtAddEventHandler( Base_Region_Wgt, Ph_EV_BUT_PRESS, base_region_cb, NULL );
Anybody see what I’m doing wrong?