Changeset b3b1b05


Ignore:
Timestamp:
Sep 18, 2010, 5:07:39 PM (10 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
03ca005
Parents:
7ba2ad4
git-author:
David Benjamin <davidben@mit.edu> (08/01/10 01:06:10)
git-committer:
David Benjamin <davidben@mit.edu> (09/18/10 17:07:39)
Message:
To be thorough, track all signal ids in the popwin

This isn't actually necessary here, but it's more correct. The
awkwardness suggests that we want the widgets to be GObjects so that
owl_signal_connect_object may do this automatically.
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • owl.h

    r691d012 rb3b1b05  
    408408  owl_window *border;
    409409  owl_window *content;
     410  gulong sig_redraw_id;
     411  gulong sig_resize_id;
    410412  int active;
    411413} owl_popwin;
  • popwin.c

    r6425d43 rb3b1b05  
    1313  pw->border = owl_window_new(NULL);
    1414  pw->content = owl_window_new(pw->border);
    15   g_signal_connect(pw->border, "redraw", G_CALLBACK(owl_popwin_draw_border), 0);
     15  /* To be thorough, we ensure each signal is disconnected when we close. */
     16  pw->sig_redraw_id =
     17    g_signal_connect(pw->border, "redraw", G_CALLBACK(owl_popwin_draw_border), 0);
     18  pw->sig_resize_id =
     19    g_signal_connect(pw->border, "resized", G_CALLBACK(owl_popwin_size_content), pw);
    1620  owl_signal_connect_object(owl_window_get_screen(), "resized", G_CALLBACK(owl_popwin_size_border), pw->border, 0);
    17   owl_signal_connect_object(pw->border, "resized", G_CALLBACK(owl_popwin_size_content), pw->content, 0);
    1821
    1922  /* bootstrap sizing */
     
    4548{
    4649  int lines, cols;
    47   owl_window *content = user_data;
     50  owl_popwin *pw = user_data;
    4851  owl_window_get_position(parent, &lines, &cols, 0, 0);
    49   owl_window_set_position(content, lines-2, cols-2, 1, 1);
     52  owl_window_set_position(pw->content, lines-2, cols-2, 1, 1);
    5053}
    5154
     
    7376  if (!pw->active)
    7477    return 1;
     78  g_signal_handler_disconnect(pw->border, pw->sig_resize_id);
     79  g_signal_handler_disconnect(pw->border, pw->sig_redraw_id);
    7580  owl_window_unlink(pw->border);
    7681  g_object_unref(pw->border);
Note: See TracChangeset for help on using the changeset viewer.