[comp.windows.x] uwm.new patch #4

jkh@dana.UUCP (Jordan K. Hubbard) (12/15/87)

# This is a shell archive.  Remove anything before this line, then
# unpack it by saving it in a file and typing "sh file".  (Files
# unpacked will be owned by you and have default permissions.)
#
# This archive contains:
# uwm.new.patch4

echo x - uwm.new.patch4
sed 's/^	//' > "uwm.new.patch4" << '//E*O*F uwm.new.patch4//'
	Date: Mon, 14 Dec 87 18:00 PST
	From: Jordan Hubbard <jkh@violet.berkeley.edu>
	Subject: uwm.new patch #4, use correct method of determining event coords.
	
	DESCRIPTION:
		The QueryPointer call for determining the proper x, y coords of a title
		bar event was bogus and worked only if you didn't move the mouse too
		much after the down event. Should have been fixed before release, but
		I forgot..
	
	FIX:
	
	*** uwm.new/uwm.c	Mon Dec 14 19:45:24 1987
	--- uwm.new/uwm.c.new	Mon Dec 14 19:35:33 1987
	***************
	*** 493,507 ****
	  		    context = ICON;
	  	       else if ((dat = GetTitleInfo(event_win)) != NULL) {
	  #ifdef DEBUG
	! 		    prt_info(&button_event);
	  #endif
	  		    if (dat->title == event_win) {
	  			 Window root;
	  			 int junk;
	! 			 XQueryPointer(dpy, RootWindow(dpy, scr), &root, &junk,
	! 				       &x, &y, &down_x, &down_y, &junk);
	! 			 if (event_win == dat->title)
	! 			      context = TITLE;
	  		    }
	  		    else
	  			 context = WINDOW;
	--- 493,513 ----
	  		    context = ICON;
	  	       else if ((dat = GetTitleInfo(event_win)) != NULL) {
	  #ifdef DEBUG
	! 		    prt_info(&button_event, dat);
	  #endif
	  		    if (dat->title == event_win) {
	  			 Window root;
	  			 int junk;
	! 			 /*
	! 			  * The original x, y coords were relative to the
	! 			  * title window, and therefore useless. We have
	! 			  * to convert them back to root relative ones..
	! 			  */
	! 			 XTranslateCoordinates(dpy, event_win,
	! 			   RootWindow(dpy, scr), x, y, &down_x, &down_y, &junk);
	! 			 x = down_x;
	! 			 y = down_y;
	! 			 context = TITLE;
	  		    }
	  		    else
	  			 context = WINDOW;
	***************
	*** 953,965 ****
	  }
	  
	  #ifdef DEBUG
	! prt_info(ev)
	  XButtonEvent *ev;
	  {
	       fprintf(stderr, "EVENT_DETAIL: win: %x, subwin: %x, xy: (%d, %d)\n",
	  	     ev->window, ev->subwindow, ev->x, ev->y);
	!      if ((dat = GetTitleInfo(ev->window)) != NULL)
	  	  fprintf(stderr, "Event window is TITLED: frame: %x, title: %x, subwin: %x\n",
	! 		  dat->parent, dat->title, dat->subwin);
	  }
	  #endif
	--- 959,972 ----
	  }
	  
	  #ifdef DEBUG
	! prt_info(ev, d)
	  XButtonEvent *ev;
	+ TitleData *d;
	  {
	       fprintf(stderr, "EVENT_DETAIL: win: %x, subwin: %x, xy: (%d, %d)\n",
	  	     ev->window, ev->subwindow, ev->x, ev->y);
	!      if (d)
	  	  fprintf(stderr, "Event window is TITLED: frame: %x, title: %x, subwin: %x\n",
	! 		  d->parent, d->title, d->subwin);
	  }
	  #endif
//E*O*F uwm.new.patch4//

exit 0