[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

2885.0. "XLowerWindow to the DECterm window...." by EWBV37::HIME (I hate you FORTRAN) Wed Jun 06 1990 05:32

	
	A question about XlowerWindow on DECterm window.

	Using following program, XRaiseWindow does work fine 
	but XLowerWindow does'nt.  Is there any differrence 
	between Raise and Lower?

	Anybody Anyhelp?


							-Toru Hime.- 

#ifndef DECTERM_CLASS
#define DECTERM_CLASS "DECW$TERMINAL"
#define DECTERM_NAME  "decw$terminal"
#endif

#include <stdio.h>
#include <signal.h>
#include <decw$include/Xlib.h>
#include <decw$include/Xutil.h>

static void WalkWindowTree();  
static int count;
main(argc, argv)
   unsigned int argc;
   char *argv[];
{
   Display *display;

   if (!(display = XOpenDisplay(NULL))) {
      fprintf(stderr, "Can't open display\n");
      exit(0);
   }

   WalkWindowTree(display, RootWindow(display, DefaultScreen(display)));
   exit(1);
}

static void WalkWindowTree(display, window)
   Display *display;
   Window window;
{
   Window root, parent, *children;
   int nchildren;
   XClassHint ch;
   char *name;
 
   ch.res_name = NULL;
   ch.res_class = NULL;
   if (XGetClassHint(display, window, &ch) == Success) {
      if (ch.res_class && strcmp(ch.res_class, DECTERM_CLASS) == 0) {
         if (ch.res_name && strcmp(ch.res_name, DECTERM_NAME) == 0) {
            name = NULL;
            XFetchName(display, window, &name);
            printf("%d, %s\n", window, name);
            if (name) XFree(name);

            printf("count = %d\n", count);
            if (count == 0){
                count = 1;
  
            printf("Window Popup \n");
            XRaiseWindow(display, window);
            XSetInputFocus(display, window, RevertToParent, CurrentTime);
	    XFlush(display);  
            sleep(5); 
            XLowerWindow(display, window);
	    XFlush(display);  
            sleep(5); 

                      }
         }
     }
     if (ch.res_name)  XFree(ch.res_name);
     if (ch.res_class) XFree(ch.res_class);
  }

   XQueryTree(display, window, &root, &parent, &children, &nchildren);
   if (nchildren) {
      register int i;
      register Window *child;

      for (i = 0, child = children; i < nchildren; ++i, ++child)
         WalkWindowTree(display, *child);
      XFree(children);
   }
   return;
}


T.RTitleUserPersonal
Name
DateLines
2885.1No can doDECWIN::KLEINWed Jun 06 1990 13:434
XLowerWindow on a shell window appears to be a no-op due to a bug (?) in
the XUI window manager.  As far as I know, no workaround has been found.

-steve-