Changeset 9eb38bb for functions.c


Ignore:
Timestamp:
Sep 18, 2010, 5:07:39 PM (11 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.7, release-1.8, release-1.9
Children:
d574d61
Parents:
8ee712e0
git-author:
David Benjamin <davidben@mit.edu> (08/01/10 14:09:34)
git-committer:
David Benjamin <davidben@mit.edu> (09/18/10 17:07:39)
Message:
Likewise, don't reuse a global owl_viewwin

This means we don't have to support plugging and unplugging that thing
over and over. We also can almost entirely drop the global owl_viewwin.
Most of the code gets it from the context anyway.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • functions.c

    r03ca005 r9eb38bb  
    12371237  owl_viewwin *v;
    12381238
    1239   v=owl_global_get_viewwin(&g);
    1240 
    1241   if (owl_global_get_popwin(&g)) {
     1239  if (owl_global_get_popwin(&g) || owl_global_get_viewwin(&g)) {
    12421240    owl_function_error("Popwin already in use.");
    12431241    return;
     
    12461244  owl_global_set_popwin(&g, pw);
    12471245  owl_popwin_up(pw);
     1246
     1247  v = owl_viewwin_new_text(owl_popwin_get_content(pw), text);
     1248  owl_global_set_viewwin(&g, v);
     1249
    12481250  owl_global_push_context(&g, OWL_CTX_POPLESS, v, "popless", NULL);
    1249   owl_viewwin_init_text(v, owl_popwin_get_content(pw), text);
    12501251}
    12511252
     
    12551256  owl_viewwin *v;
    12561257
    1257   v=owl_global_get_viewwin(&g);
    1258 
    1259   if (owl_global_get_popwin(&g)) {
     1258  if (owl_global_get_popwin(&g) || owl_global_get_viewwin(&g)) {
    12601259    owl_function_error("Popwin already in use.");
    12611260    return;
     
    12641263  owl_global_set_popwin(&g, pw);
    12651264  owl_popwin_up(pw);
     1265
     1266  v = owl_viewwin_new_fmtext(owl_popwin_get_content(pw), fm);
     1267  owl_global_set_viewwin(&g, v);
     1268
    12661269  owl_global_push_context(&g, OWL_CTX_POPLESS, v, "popless", NULL);
    1267   owl_viewwin_init_fmtext(v, owl_popwin_get_content(pw), fm);
    12681270}
    12691271
Note: See TracChangeset for help on using the changeset viewer.