diff options
author | Ole Loots <ole@monochrom.net> | 2011-03-20 22:38:32 +0000 |
---|---|---|
committer | Ole Loots <ole@monochrom.net> | 2011-03-20 22:38:32 +0000 |
commit | 2e8d22b83d78aa1c65e490c78750fbba4beda479 (patch) | |
tree | acb53d7758ab27d5e068b1bb3f6b12bea52d126e /atari | |
parent | 7f38f0f70eef7579f657be5f2e56cbbec23ebc89 (diff) | |
download | netsurf-2e8d22b83d78aa1c65e490c78750fbba4beda479.tar.gz netsurf-2e8d22b83d78aa1c65e490c78750fbba4beda479.tar.bz2 |
Allocate window title string memory dynamically.
svn path=/trunk/netsurf/; revision=12111
Diffstat (limited to 'atari')
-rwxr-xr-x | atari/browser_win.c | 8 | ||||
-rwxr-xr-x | atari/gui.h | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/atari/browser_win.c b/atari/browser_win.c index 103ff1f7c..05131f0e0 100755 --- a/atari/browser_win.c +++ b/atari/browser_win.c @@ -55,6 +55,7 @@ #include "atari/plot/plotter.h"
#include "atari/dragdrop.h"
#include "atari/search.h"
+#include "atari/osspec.h"
bool cfg_rt_resize = false;
@@ -116,6 +117,7 @@ int window_create( struct gui_window * gw, struct browser_window * bw, unsigned if( gw->root == NULL )
return( -1 );
memset( gw->root, 0, sizeof(struct s_gui_win_root) );
+ gw->root->title = malloc(atari_sysinfo.aes_max_win_title_len+1);
gw->root->handle = WindCreate( flags,40, 40, app.w, app.h );
gw->root->cmproot = mt_CompCreate(&app, CLT_VERTICAL, 1, 1);
WindSetPtr( gw->root->handle, WF_COMPONENT, gw->root->cmproot, NULL);
@@ -140,8 +142,9 @@ int window_create( struct gui_window * gw, struct browser_window * bw, unsigned }
WindSetStr(gw->root->handle, WF_ICONTITLE, (char*)"NetSurf");
+
+ /* Event Handlers: */
EvntDataAttach( gw->root->handle, WM_CLOSED, evnt_window_close, NULL );
-
/* capture resize/move events so we can handle that manually */
if( !cfg_rt_resize ) {
EvntAttach( gw->root->handle, WM_SIZED, evnt_window_resize);
@@ -206,6 +209,9 @@ int window_destroy( struct gui_window * gw) /* needed? */ /*listRemove( (LINKABLE*)gw->root->cmproot ); */
LOG(("Freeing root window"));
if( gw->root ) {
+ /* TODO: check if no other browser is bound to this root window! */
+ if( gw->root->title )
+ free( gw->root->title );
if( gw->root->cmproot )
mt_CompDelete( &app, gw->root->cmproot );
ApplWrite( _AESapid, WM_DESTROY, gw->root->handle->handle, 0, 0, 0, 0);
diff --git a/atari/gui.h b/atari/gui.h index ece6d99f2..75c17eb26 100755 --- a/atari/gui.h +++ b/atari/gui.h @@ -217,7 +217,7 @@ struct s_gui_win_root struct s_focus_info focus; float scale; bool throbbing; - char title[80]; + char * title; GRECT loc; /* current size of window on screen */ }; |