comparison src/X_supp.c @ 81:13fdf205047b

Hide shapes and groups
author Thinker K.F. Li <thinker@branda.to>
date Thu, 21 Aug 2008 13:52:23 +0800
parents 3645e29e4986
children 4bb6451ef036
comparison
equal deleted inserted replaced
80:e548221c04eb 81:13fdf205047b
74 redraw_man_t *rdman, 74 redraw_man_t *rdman,
75 mb_tman_t *tman) { 75 mb_tman_t *tman) {
76 XEvent evt; 76 XEvent evt;
77 XMotionEvent *mevt; 77 XMotionEvent *mevt;
78 XButtonEvent *bevt; 78 XButtonEvent *bevt;
79 co_aix x, y; 79 XExposeEvent *eevt;
80 co_aix x, y, w, h;
81
82 int eflag = 0;
83 int ex1, ey1, ex2, ey2;
84
80 unsigned int state, button; 85 unsigned int state, button;
81 int r; 86 int r;
82 87
83 while(XEventsQueued(display, QueuedAfterReading) > 0) { 88 while(XEventsQueued(display, QueuedAfterReading) > 0) {
84 r = XNextEvent(display, &evt); 89 r = XNextEvent(display, &evt);
116 121
117 notify_shapes(rdman, x, y, EVT_MOUSE_MOVE, state, 0); 122 notify_shapes(rdman, x, y, EVT_MOUSE_MOVE, state, 0);
118 break; 123 break;
119 124
120 case Expose: 125 case Expose:
121 rdman_redraw_area(rdman, evt.xexpose.x, evt.xexpose.y, 126 eevt = &evt.xexpose;
122 evt.xexpose.width, evt.xexpose.height); 127 x = eevt->x;
128 y = eevt->y;
129 w = eevt->width;
130 h = eevt->height;
131
132 if(eflag) {
133 if(x < ex1)
134 ex1 = x;
135 if(y < ey1)
136 ey1 = y;
137 if((x + w) > ex2)
138 ex2 = x + w;
139 if((y + h) > ey2)
140 ey2 = y + h;
141 } else {
142 ex1 = x;
143 ey1 = y;
144 ex2 = x + w;
145 ey2 = y + h;
146 eflag = 1;
147 }
123 break; 148 break;
124 } 149 }
125 } 150 }
126 rdman_redraw_changed(rdman); 151 if(eflag) {
152 rdman_redraw_area(rdman, ex1, ey1, (ex2 - ex1), (ey2 - ey1));
153 eflag = 0;
154 }
127 XFlush(display); 155 XFlush(display);
128 } 156 }
129 157
130 /*! \brief Handle connection coming data and timeout of timers. 158 /*! \brief Handle connection coming data and timeout of timers.
131 * 159 *