aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authormallum <mallum@b067294f-1dea-0310-9683-c47a78595994>2005-01-21 17:49:04 +0000
committermallum <mallum@b067294f-1dea-0310-9683-c47a78595994>2005-01-21 17:49:04 +0000
commit7e2989f7800735544c016c062db15fce6bd1a408 (patch)
tree9e9b693fdbb9b27e00add728a884db174a00df4b /src
parent4d025850330207c7e9bb1eb5137af9b775c52776 (diff)
downloadmatchbox-panel-7e2989f7800735544c016c062db15fce6bd1a408.tar.gz
matchbox-panel-7e2989f7800735544c016c062db15fce6bd1a408.tar.bz2
matchbox-panel-7e2989f7800735544c016c062db15fce6bd1a408.zip
Various fixes see changelog
git-svn-id: https://svn.o-hand.com/repos/matchbox/trunk/matchbox-panel@1039 b067294f-1dea-0310-9683-c47a78595994
Diffstat (limited to 'src')
-rw-r--r--src/panel.c15
-rw-r--r--src/panel.h17
-rw-r--r--src/panel_app.c13
-rw-r--r--src/session.c12
4 files changed, 50 insertions, 7 deletions
diff --git a/src/panel.c b/src/panel.c
index c43da93..6c2daed 100644
--- a/src/panel.c
+++ b/src/panel.c
@@ -824,10 +824,19 @@ panel_handle_dock_request(MBPanel *panel, Window win)
util_get_command_str_from_win(panel, win, &cmd_str); /* cmd_str freed l8r */
- if (session_preexisting_win_matches_wanted(panel, win, cmd_str))
+ if (session_preexisting_restarting(panel))
{
- app_origin_dist = panel->session_init_offset;
- session_preexisting_clear_current(panel);
+ if (session_preexisting_win_matches_wanted(panel, win, cmd_str))
+ {
+ app_origin_dist = panel->session_init_offset;
+ session_preexisting_clear_current(panel);
+ }
+ else
+ {
+ DBG("%s() defering winid %li ( %s) \n", __func__, win, cmd_str );
+ panel->session_defered_wins[panel->n_session_defered_wins++] = win;
+ return;
+ }
}
new_papp = panel_app_new(panel, win, cmd_str);
diff --git a/src/panel.h b/src/panel.h
index e7f9081..20f6be6 100644
--- a/src/panel.h
+++ b/src/panel.h
@@ -112,6 +112,8 @@
#define DEFAULT_COLOR_SPEC "#e2e2de" /* Same as gnome ? */
#define MB_MSG_FONT "Sans 14px"
+#define MAX_DEFERED_WINS 32 /* *very* Unlikely as much as 32 */
+
enum {
BG_SOLID_COLOR,
BG_PIXMAP,
@@ -281,10 +283,19 @@ typedef struct _panel {
int click_y;
Time click_time;
-
char *bg_trans;
long root_pixmap_id;
+ /* Defered apps list - win ids that start while session is
+ * starting but *arnt* in the session, so they are docked
+ * after starting.
+ *
+ * XXX: should really use a list here.
+ */
+
+ Window session_defered_wins[MAX_DEFERED_WINS];
+ int n_session_defered_wins;
+
#ifdef USE_XSETTINGS
XSettingsClient *xsettings_client;
#endif
@@ -309,6 +320,10 @@ panel_update_client_list_prop (MBPanel *panel);
void
panel_reorder_apps(MBPanel *panel);
+void
+panel_handle_dock_request(MBPanel *panel, Window win);
+
+
#include "panel_menu.h"
#include "panel_util.h"
#include "panel_app.h"
diff --git a/src/panel_app.c b/src/panel_app.c
index d7833ac..1e7ae91 100644
--- a/src/panel_app.c
+++ b/src/panel_app.c
@@ -377,20 +377,27 @@ panel_app_handle_configure_request(MBPanel *panel, XConfigureRequestEvent *ev)
{
if (papp == panel_app_list_get_last(panel, panel->apps_end_head))
{
- DBG("%s() papp is last at end\n", __func__);
+ DBG("%s() papp %s is last at end\n", __func__, papp->name);
panel_app_move_to(panel, papp,
papp->x - (xwc.width - papp->w));
}
else if (papp == panel_app_list_get_last(panel,
panel->apps_start_head))
{
- DBG("%s() papp is last at start\n", __func__);
+ DBG("%s() papp %s is last at start\n", __func__, papp->name);
panel_app_move_to(panel, papp,
papp->x /*+ (xwc.width - papp->w)*/);
}
+ else if (papp == panel->apps_end_head)
+ {
+ DBG("******** %s() papp %s panel->apps_end_head ****\n", __func__, papp->name);
+ panel_app_move_to(panel, papp,
+ panel->w - panel->margin_sides - xwc.width);
+ panel_apps_nudge (panel, papp->next, papp->w - xwc.width);
+ }
else
{
- DBG("%s() papp is nowhere special\n", __func__);
+ DBG("%s() papp %s is nowhere special\n", __func__, papp->name);
panel_apps_nudge (panel, papp->next, xwc.width - papp->w);
}
papp->w = xwc.width;
diff --git a/src/session.c b/src/session.c
index 8262ca3..9af9890 100644
--- a/src/session.c
+++ b/src/session.c
@@ -174,6 +174,8 @@ session_preexisting_restarting(MBPanel *panel)
Bool
session_preexisting_start_next(MBPanel *panel)
{
+ int i = 0;
+
if (!session_preexisting_restarting(panel)) return False;
if (panel->session_entry_cur[0] == '\0'
@@ -183,6 +185,15 @@ session_preexisting_start_next(MBPanel *panel)
panel->session_needed_pid = util_fork_exec(panel->session_entry_cur);
return True;
}
+
+ /* Nothing left in session, dock any defered */
+
+ DBG("%s() Now launching defered apps\n", __func__);
+
+ for (i=0; i<panel->n_session_defered_wins; i++)
+ panel_handle_dock_request(panel, panel->session_defered_wins[i]);
+
+
return False;
}
@@ -191,6 +202,7 @@ session_preexisting_win_matches_wanted(MBPanel *panel, Window win,
char *win_cmd)
{
pid_t win_pid = 0;
+
if (!session_preexisting_restarting(panel)) return False;
DBG("%s() called\n", __func__);