Changeset f70a7a3
- Timestamp:
- Jun 3, 2010, 2:37:58 AM (15 years ago)
- Branches:
- master, release-1.10, release-1.7, release-1.8, release-1.9
- Children:
- 571fab7
- Parents:
- cc36f27
- git-author:
- David Benjamin <davidben@mit.edu> (06/03/10 02:32:28)
- git-committer:
- David Benjamin <davidben@mit.edu> (06/03/10 02:37:58)
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
window.c
rcc36f27 rf70a7a3 43 43 44 44 static owl_window *cursor_owner; 45 static owl_window *default_cursor; 45 46 46 47 G_DEFINE_TYPE (OwlWindow, owl_window, G_TYPE_OBJECT) … … 334 335 g_object_remove_weak_pointer(G_OBJECT(cursor_owner), (gpointer*) &cursor_owner); 335 336 cursor_owner = w; 336 g_object_add_weak_pointer(G_OBJECT(w), (gpointer*) &cursor_owner); 337 if (w) 338 g_object_add_weak_pointer(G_OBJECT(w), (gpointer*) &cursor_owner); 337 339 owl_global_set_needrefresh(&g); 340 } 341 342 void owl_window_set_default_cursor(owl_window *w) 343 { 344 if (default_cursor) 345 g_object_remove_weak_pointer(G_OBJECT(default_cursor), (gpointer*) &default_cursor); 346 default_cursor = w; 347 if (w) 348 g_object_add_weak_pointer(G_OBJECT(w), (gpointer*) &default_cursor); 349 owl_global_set_needrefresh(&g); 350 } 351 352 static owl_window *_get_cursor(void) 353 { 354 if (cursor_owner && owl_window_is_realized(cursor_owner)) 355 return cursor_owner; 356 if (default_cursor && owl_window_is_realized(default_cursor)) 357 return default_cursor; 358 return owl_window_get_screen(); 338 359 } 339 360 … … 389 410 void owl_window_redraw_scheduled(void) 390 411 { 412 owl_window *cursor; 413 391 414 _owl_window_redraw_subtree(owl_window_get_screen()); 392 415 update_panels(); 393 if (cursor_owner && cursor_owner->win) { 416 cursor = _get_cursor(); 417 if (cursor && cursor->win) { 394 418 /* untouch it to avoid drawing; window should be clean now, but we must 395 419 * clean up in case there was junk left over on a subwin (cleaning up after 396 420 * subwin drawing isn't sufficient because a wsyncup messes up subwin 397 421 * ancestors */ 398 untouchwin(cursor _owner->win);399 wnoutrefresh(cursor _owner->win);422 untouchwin(cursor->win); 423 wnoutrefresh(cursor->win); 400 424 } 401 425 } -
window.h
r84a4aca rf70a7a3 44 44 45 45 void owl_window_set_cursor(owl_window *w); 46 void owl_window_set_default_cursor(owl_window *w); 46 47 47 48 void owl_window_dirty(owl_window *w); … … 53 54 void owl_window_move(owl_window *w, int begin_y, int begin_x); 54 55 void owl_window_resize(owl_window *w, int nlines, int ncols); 55 void owl_window_recompute_position(owl_window *w);56 56 57 57 void owl_window_top(owl_window *w);
Note: See TracChangeset
for help on using the changeset viewer.