Mercurial > hg > xemacs-beta
comparison src/frame-x.c @ 30:ec9a17fef872 r19-15b98
Import from CVS: tag r19-15b98
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:52:29 +0200 |
parents | 859a2309aef8 |
children | 131b0175ea99 |
comparison
equal
deleted
inserted
replaced
29:7976500f47f9 | 30:ec9a17fef872 |
---|---|
2182 Window emacs_window; | 2182 Window emacs_window; |
2183 XWindowChanges xwc; | 2183 XWindowChanges xwc; |
2184 unsigned int flags; | 2184 unsigned int flags; |
2185 Display *display = DEVICE_X_DISPLAY (XDEVICE (f->device)); | 2185 Display *display = DEVICE_X_DISPLAY (XDEVICE (f->device)); |
2186 | 2186 |
2187 if (f->visible || force) | 2187 if (FRAME_VISIBLE_P(f) || force) |
2188 { | 2188 { |
2189 emacs_window = XtWindow (FRAME_X_SHELL_WIDGET (f)); | 2189 emacs_window = XtWindow (FRAME_X_SHELL_WIDGET (f)); |
2190 /* first raises all the dialog boxes, then put emacs just below the | 2190 /* first raises all the dialog boxes, then put emacs just below the |
2191 * bottom most dialog box */ | 2191 * bottom most dialog box */ |
2192 bottom_dialog = lw_raise_all_pop_up_widgets (); | 2192 bottom_dialog = lw_raise_all_pop_up_widgets (); |
2221 { | 2221 { |
2222 Display *display = DEVICE_X_DISPLAY (XDEVICE (f->device)); | 2222 Display *display = DEVICE_X_DISPLAY (XDEVICE (f->device)); |
2223 XWindowChanges xwc; | 2223 XWindowChanges xwc; |
2224 unsigned int flags; | 2224 unsigned int flags; |
2225 | 2225 |
2226 if (f->visible) | 2226 if (FRAME_VISIBLE_P(f)) |
2227 { | 2227 { |
2228 xwc.stack_mode = Below; | 2228 xwc.stack_mode = Below; |
2229 flags = CWStackMode; | 2229 flags = CWStackMode; |
2230 if (!XReconfigureWMWindow (display, XtWindow (FRAME_X_SHELL_WIDGET (f)), | 2230 if (!XReconfigureWMWindow (display, XtWindow (FRAME_X_SHELL_WIDGET (f)), |
2231 DefaultScreen (display), flags, &xwc)) | 2231 DefaultScreen (display), flags, &xwc)) |
2237 static void | 2237 static void |
2238 x_make_frame_visible (struct frame *f) | 2238 x_make_frame_visible (struct frame *f) |
2239 { | 2239 { |
2240 Display *display = DEVICE_X_DISPLAY (XDEVICE (f->device)); | 2240 Display *display = DEVICE_X_DISPLAY (XDEVICE (f->device)); |
2241 | 2241 |
2242 if (!f->visible) | 2242 if (!FRAME_VISIBLE_P(f)) |
2243 XMapRaised (display, XtWindow (FRAME_X_SHELL_WIDGET (f))); | 2243 XMapRaised (display, XtWindow (FRAME_X_SHELL_WIDGET (f))); |
2244 else | 2244 else |
2245 x_raise_frame_1 (f, 0); | 2245 x_raise_frame_1 (f, 0); |
2246 } | 2246 } |
2247 | 2247 |
2249 static void | 2249 static void |
2250 x_make_frame_invisible (struct frame *f) | 2250 x_make_frame_invisible (struct frame *f) |
2251 { | 2251 { |
2252 Display *display = DEVICE_X_DISPLAY (XDEVICE (f->device)); | 2252 Display *display = DEVICE_X_DISPLAY (XDEVICE (f->device)); |
2253 | 2253 |
2254 if (!f->visible) | 2254 if (!FRAME_VISIBLE_P(f)) |
2255 return; | 2255 return; |
2256 | 2256 |
2257 if (!XWithdrawWindow (display, | 2257 if (!XWithdrawWindow (display, |
2258 XtWindow (FRAME_X_SHELL_WIDGET (f)), | 2258 XtWindow (FRAME_X_SHELL_WIDGET (f)), |
2259 DefaultScreen (display))) | 2259 DefaultScreen (display))) |
2265 { | 2265 { |
2266 Display *display = DEVICE_X_DISPLAY (XDEVICE (f->device)); | 2266 Display *display = DEVICE_X_DISPLAY (XDEVICE (f->device)); |
2267 XWindowAttributes xwa; | 2267 XWindowAttributes xwa; |
2268 int result; | 2268 int result; |
2269 | 2269 |
2270 /* JV: | |
2271 This is bad, very bad :-( | |
2272 It is not compatible with our tristate visible and | |
2273 it should never ever change the visibility for us, this leads to | |
2274 the frame-freeze problem under fvwm because with the pager | |
2275 | |
2276 Mappedness != Viewability != Visibility != Emacs f->visible | |
2277 | |
2278 This first unequalness is the reason for the frame freezing problem | |
2279 under fvwm (it happens when the frame is another fvwm-page) | |
2280 | |
2281 The second unequalness happen when it is on the same fvwm-page | |
2282 but in an invisible part of the visible screen. | |
2283 | |
2284 For now we just return the XEmacs internal value --- which might not be up | |
2285 to date. Is that a problem? ---. Otherwise we should | |
2286 use async visibility like in standard Emacs. | |
2287 */ | |
2288 | |
2289 #if 0 | |
2270 if (!XGetWindowAttributes (display, | 2290 if (!XGetWindowAttributes (display, |
2271 XtWindow (FRAME_X_SHELL_WIDGET (f)), | 2291 XtWindow (FRAME_X_SHELL_WIDGET (f)), |
2272 &xwa)) | 2292 &xwa)) |
2273 result = 0; | 2293 result = 0; |
2274 else | 2294 else |
2275 result = xwa.map_state == IsViewable; | 2295 result = xwa.map_state == IsViewable; |
2296 /* In this implementation it should at least be != IsUnmapped | |
2297 JV */ | |
2276 | 2298 |
2277 f->visible = result; | 2299 f->visible = result; |
2278 return result; | 2300 return result; |
2301 #endif | |
2302 | |
2303 return f->visible; | |
2279 } | 2304 } |
2280 | 2305 |
2281 static int | 2306 static int |
2282 x_frame_totally_visible_p (struct frame *f) | 2307 x_frame_totally_visible_p (struct frame *f) |
2283 { | 2308 { |
2302 static void | 2327 static void |
2303 x_focus_on_frame (struct frame *f) | 2328 x_focus_on_frame (struct frame *f) |
2304 { | 2329 { |
2305 XWindowAttributes xwa; | 2330 XWindowAttributes xwa; |
2306 Widget shell_widget; | 2331 Widget shell_widget; |
2332 int viewable; | |
2307 | 2333 |
2308 assert (FRAME_X_P (f)); | 2334 assert (FRAME_X_P (f)); |
2309 | 2335 |
2310 shell_widget = FRAME_X_SHELL_WIDGET (f); | 2336 shell_widget = FRAME_X_SHELL_WIDGET (f); |
2311 if (!XtWindow (shell_widget)) | 2337 if (!XtWindow (shell_widget)) |
2325 */ | 2351 */ |
2326 XGrabServer (XtDisplay (shell_widget)); | 2352 XGrabServer (XtDisplay (shell_widget)); |
2327 if (XGetWindowAttributes (XtDisplay (shell_widget), | 2353 if (XGetWindowAttributes (XtDisplay (shell_widget), |
2328 XtWindow (shell_widget), | 2354 XtWindow (shell_widget), |
2329 &xwa)) | 2355 &xwa)) |
2330 f->visible = xwa.map_state == IsViewable; | 2356 /* JV: it is bad to change the visibility like this, so we don't for the |
2357 moment, at least change_frame_visibility should be called | |
2358 Note also that under fvwm a frame can me Viewable (and thus Mapped) | |
2359 but still X-invisible | |
2360 f->visible = xwa.map_state == IsViewable; */ | |
2361 viewable = xwa.map_state == IsViewable; | |
2362 | |
2331 | 2363 |
2332 if (f->visible) | 2364 if (viewable) |
2333 { | 2365 { |
2334 Window focus; | 2366 Window focus; |
2335 int revert_to; | 2367 int revert_to; |
2336 XGetInputFocus (XtDisplay (shell_widget), &focus, &revert_to); | 2368 XGetInputFocus (XtDisplay (shell_widget), &focus, &revert_to); |
2337 /* Don't explicitly set the focus on this window unless the focus | 2369 /* Don't explicitly set the focus on this window unless the focus |