Re: XForms: return after window resize

moini@eleceng.adelaide.edu.au
Thu, 16 Oct 1997 17:56:58 +0930 (CST)

To subscribers of the xforms list from moini@eleceng.adelaide.edu.au :

> > Is there anyway to know if a window has been resized?
> > Something like fl_at_winresize(...)
>
> Use fl_addto_selected_xevent() to add a selection for ConfigureNotify
> (the raw X Event signifying a window resize) and then register a raw
> callback with fl_register_raw_callback() with the mask FL_ALL_EVENT.
> Your callback will have to filter the extraneous events with something
> like
>
> int your_callback( FL_FORM *form, void *xevent )
>
> {
>
> XEvent *any_event = ( XEvent *) xevent;
>
> if ( any_event->type == ConfigureNotify ) {
>
> /* do your stuff */
>
> }
>
> return 0;
>
> }
>
> spl

This sort of worked and sort of didn't. The problem that I have now is that
if I return FL_PREEMPT ater doing my stuff, then a lot of redrawing
functions stuff up. If I don't return FL_PREEMPT then other events also
happen after the ConfigureNotify, and they tend to evoke the internal
resizing operations, which I don't like. I also found that when I use the
(UN)Maximize function of the window manager the ConfigureNotify is sent
twice and the trick works, but if I drag the corners of the windows, it is
just sent once at the begining of the operation. (I am using fvwm2).

I also couldn't get the code working with fl_addto_selected_xevent

/************************/
Window VW;

VW=create_form_panel();

fl_addto_selected_xevent(VW, ConfigureNotify);
/************************/

It complains with

X Error of failed request: BadWindow (invalid Window parameter)
Major opcode of failed request: 3 (X_GetWindowAttributes)
Resource id in failed request: 0x0
Serial number of failed request: 140
Current serial number in output stream: 140

uname -a
SunOS dice.eleceng.adelaide.edu.au 5.5.1 Generic_103640-08 sun4u sparc SUNW,Ultra-1

X11R6.1 Xforms0.87

************************************************************************
** Alireza Moini (Ali) **
** **
** Research Associate **
** Centre for High Performance Integrated Technologies and Systems **
** Department of Electrical & Electronics Engineering **
** The University of Adelaide **
** South Australia 5005 **
** Phone: 61 8 8303 3403(Vision Lab.) Fax: 61 8 8303 4360 **
************************ WWW Page *********************************
** http://www.eleceng.adelaide.edu.au/Personal/moini/index.html **
** http://www.eleceng.adelaide.edu.au/Groups/GAAS/bugeye.html **
************************************************************************
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
Xforms Home Page: http://bragg.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/