nanogui: Thread: Small patch for move window


[<<] [<] Page 1 of 1 [>] [>>]
Subject: Small patch for move window
From: ####@####.####
Date: 8 Oct 2000 03:24:30 -0000
Message-Id: <Pine.LNX.4.10.10010072031590.23192-200000@link.ece.uci.edu>

The following patch is used to implement move window in box mode to reduce
the flicking when we move the window. Instead of move the content of the
window, we just draw a box on screen. This can reduce the flicking before
we have double buffer to remove the flicking. 

I notice a strange behavior.The topbar_buttondown() is called even I press
button the client area of window. My patch will print a error message in
this case. 

Yu-Chung Wang


diff microwin/src/apps/nanowm/actions.c microwin-new/src/apps/nanowm/actions.c
15a16
> 
124c125,142
< 
---
> #ifdef USE_MOVEBOX
> 	if (window->type != WINDOW_TYPE_TOPBAR) {
> 	  printf("Hey! You shouldn't call me if you are not topbar window.\n");
> 	  return;
> 	}
> 	// I assume the parent of topbar window is the contaoner window
> 	GrGetWindowInfo(window->pid,&pos->winfo);
> 	pos->x = event->rootx;
> 	pos->y = event->rooty;
> 	// This assume the parent of the container window is root window
> 	// It's true if we don't support MDI.
> 	pos->rectx = pos->winfo.x;
> 	pos->recty = pos->winfo.y;
> 	pos->gc = GrNewGC();
> 	GrSetGCMode(pos->gc,GR_MODE_XOR);
> 	GrRect(GR_ROOT_WINDOW_ID,pos->gc, pos->winfo.x, pos->winfo.y, 
> 	       pos->winfo.width, pos->winfo.height);
> #else
126a145
> #endif
220a240,242
> #ifdef USE_MOVEBOX
>     struct position *pos;
> #endif
223a246,253
> #ifdef USE_MOVEBOX
> 	pos = (struct position *) window->data;
> 	GrRect(GR_ROOT_WINDOW_ID,pos->gc, pos->rectx, pos->recty, pos->winfo.width, pos->winfo.height);
> 	GrMoveWindow(window->pid, pos->rectx + event->rootx - pos->x,
> 			pos->recty + event->rooty - pos->y);
> 	GrDestroyGC(pos->gc);
> 	pos->gc = -1;
> #endif
347a378,385
> #ifdef USE_MOVEBOX
> 	GrRect(GR_ROOT_WINDOW_ID,pos->gc, pos->rectx, pos->recty, pos->winfo.width, pos->winfo.height);
> 	pos->rectx += event->rootx - pos->x;
> 	pos->recty += event->rooty - pos->y;
> 	pos->x = event->rootx;
> 	pos->y = event->rooty;
> 	GrRect(GR_ROOT_WINDOW_ID,pos->gc, pos->rectx, pos->recty, pos->winfo.width, pos->winfo.height);
> #else
349a388
> #endif
diff microwin/src/apps/nanowm/nanowm.h microwin-new/src/apps/nanowm/nanowm.h
7a8
> #define USE_MOVEBOX
73a75,79
> #ifdef USE_MOVEBOX
> 	GR_GC_ID gc;
> 	GR_WINDOW_INFO winfo;
>         GR_COORD rectx, recty;
> #endif
[<<] [<] Page 1 of 1 [>] [>>]


Powered by ezmlm-browse 0.20.