viking

webkit based web browser for Enlightenment
Log | Files | Refs | LICENSE

commit f81b00b0a195addaf6067e4a204a61b06d79e3bb
parent 0aa83cf1e43072a62dd8f168bd8924eb6e990c3b
Author: Kyle Milz <kmilz@ucalgary.ca>
Date:   Mon,  8 Oct 2012 00:47:56 -0600

implement sane window creation/deletion

Diffstat:
Msrc/commands.c | 24+++++++++++++++++++++---
1 file changed, 21 insertions(+), 3 deletions(-)

diff --git a/src/commands.c b/src/commands.c @@ -1485,11 +1485,29 @@ Eina_Bool window(const Arg *arg, void *data) { Window_Data *wd = data; + App_Data *ad = wd->app; + Session_Window *sw; + + if (arg->i & CreateWindow) { + buffer_add(InNewWindow | SwitchToBuffer, wd, (arg->s ? arg->s : NULL), NULL); + } + else if (arg->i & DeleteWindow) { + ad->windows = eina_list_remove(ad->windows, wd); + + sw = wd->session_window; + Eina_List *windows = session_windows_list_get(ad->session); + windows = eina_list_remove(windows, sw); + session_window_free(sw); + session_windows_list_set(ad->session, windows); - if (arg->i & CreateWindow) - window_add(wd->app, NULL); - else if (arg->i & DeleteWindow) + // session_windows_del(ad->session, wd->session_window); evas_object_del(wd->win); + } + + if (!ad->windows) { + ad->exiting = EINA_TRUE; + elm_exit(); + } return EINA_TRUE; }