Mercurial > pidgin.yaz
comparison finch/libgnt/gntwm.c @ 18075:34e011c8ed2b
F9 to create a new workspace.
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Sun, 10 Jun 2007 15:39:51 +0000 |
parents | 2b757aadddc9 |
children | 2141130ac557 |
comparison
equal
deleted
inserted
replaced
18074:7e309149360f | 18075:34e011c8ed2b |
---|---|
333 wm->workspaces = NULL; | 333 wm->workspaces = NULL; |
334 wm->name_places = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); | 334 wm->name_places = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); |
335 wm->title_places = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); | 335 wm->title_places = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); |
336 gnt_style_read_workspaces(wm); | 336 gnt_style_read_workspaces(wm); |
337 if (wm->workspaces == NULL) { | 337 if (wm->workspaces == NULL) { |
338 wm->cws = g_object_new(GNT_TYPE_WS, NULL); | 338 wm->cws = gnt_ws_new("default"); |
339 gnt_ws_set_name(wm->cws, "default"); | |
340 gnt_wm_add_workspace(wm, wm->cws); | 339 gnt_wm_add_workspace(wm, wm->cws); |
341 } else { | 340 } else { |
342 wm->cws = wm->workspaces->data; | 341 wm->cws = wm->workspaces->data; |
343 } | 342 } |
344 wm->event_stack = FALSE; | 343 wm->event_stack = FALSE; |
1126 list_of_windows(wm, TRUE); | 1125 list_of_windows(wm, TRUE); |
1127 | 1126 |
1128 return TRUE; | 1127 return TRUE; |
1129 } | 1128 } |
1130 | 1129 |
1130 static gboolean | |
1131 workspace_new(GntBindable *bindable, GList *null) | |
1132 { | |
1133 GntWM *wm = GNT_WM(bindable); | |
1134 GntWS *ws = gnt_ws_new(NULL); | |
1135 gnt_wm_add_workspace(wm, ws); | |
1136 gnt_wm_switch_workspace(wm, g_list_index(wm->workspaces, ws)); | |
1137 return TRUE; | |
1138 } | |
1139 | |
1131 static void | 1140 static void |
1132 gnt_wm_class_init(GntWMClass *klass) | 1141 gnt_wm_class_init(GntWMClass *klass) |
1133 { | 1142 { |
1134 int i; | 1143 int i; |
1135 | 1144 |
1260 "\033" GNT_KEY_CTRL_J, NULL); | 1269 "\033" GNT_KEY_CTRL_J, NULL); |
1261 gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "window-scroll-up", window_scroll_up, | 1270 gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "window-scroll-up", window_scroll_up, |
1262 "\033" GNT_KEY_CTRL_K, NULL); | 1271 "\033" GNT_KEY_CTRL_K, NULL); |
1263 gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "help-for-widget", help_for_widget, | 1272 gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "help-for-widget", help_for_widget, |
1264 "\033" "/", NULL); | 1273 "\033" "/", NULL); |
1274 gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "workspace-new", workspace_new, | |
1275 GNT_KEY_F9, NULL); | |
1265 gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "workspace-next", workspace_next, | 1276 gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "workspace-next", workspace_next, |
1266 "\033" ">", NULL); | 1277 "\033" ">", NULL); |
1267 gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "workspace-prev", workspace_prev, | 1278 gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "workspace-prev", workspace_prev, |
1268 "\033" "<", NULL); | 1279 "\033" "<", NULL); |
1269 gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "window-tag", tag_widget, | 1280 gnt_bindable_class_register_action(GNT_BINDABLE_CLASS(klass), "window-tag", tag_widget, |
1314 &info, 0); | 1325 &info, 0); |
1315 } | 1326 } |
1316 | 1327 |
1317 return type; | 1328 return type; |
1318 } | 1329 } |
1330 | |
1319 void | 1331 void |
1320 gnt_wm_add_workspace(GntWM *wm, GntWS *ws) | 1332 gnt_wm_add_workspace(GntWM *wm, GntWS *ws) |
1321 { | 1333 { |
1322 wm->workspaces = g_list_append(wm->workspaces, ws); | 1334 wm->workspaces = g_list_append(wm->workspaces, ws); |
1323 } | 1335 } |