[Xfce4-commits] <xfce4-wmdock-plugin:master> Added some additional options for panel off mode. Added support to set the initial startup postion in panel off mode.

Andre Ellguth noreply at xfce.org
Mon Nov 4 13:36:31 CET 2013


Updating branch refs/heads/master
         to d4d5da8306e3f12ee9bb80449291971fb6017272 (commit)
       from cf255cb4dffd80d4dea7a5d9a4495d9d2d54009b (commit)

commit d4d5da8306e3f12ee9bb80449291971fb6017272
Author: Andre Ellguth <andre at ellguth.com>
Date:   Mon Oct 14 20:08:07 2013 +0200

    Added some additional options for panel off mode.
    Added support to set the initial startup postion in panel off mode.

 panel-plugin/dockapp.c |  169 +++++++++++++++++++++++++++-------
 panel-plugin/dockapp.h |    1 +
 panel-plugin/props.c   |  236 ++++++++++++++++++++++++++++++------------------
 panel-plugin/rcfile.c  |    9 +-
 panel-plugin/rcfile.h  |   20 ++--
 panel-plugin/wmdock.c  |   12 ++-
 panel-plugin/wmdock.h  |    2 +
 7 files changed, 317 insertions(+), 132 deletions(-)

diff --git a/panel-plugin/dockapp.c b/panel-plugin/dockapp.c
index 2f5f448..e761a25 100644
--- a/panel-plugin/dockapp.c
+++ b/panel-plugin/dockapp.c
@@ -51,6 +51,7 @@ static GtkTargetEntry targetList[] = {
 static guint nTargets = G_N_ELEMENTS (targetList);
 static DockappNode *dappOnMotion = NULL, *dappDummy = NULL;
 static gint motionstartx = 0, motionstarty = 0;
+static gboolean blockDappReorder = FALSE;
 
 /**
  * Get the x coordinate child dockapp.
@@ -68,7 +69,7 @@ static void wmdock_dockapp_child_pos(DockappNode *prevDapp, gint gluepos, gint *
 	/* Setup the position of the first dockapp. */
 	prevx = prevy = 0;
 
-	if(!prevDapp)
+	if(! IS_PANELOFF(wmdock) || !prevDapp)
 		return;
 
 	/* Get the position of the previous DockApp if is accessable. */
@@ -114,12 +115,15 @@ static DockappNode *wmdock_get_snapable_dockapp(DockappNode *dapp, gint *gluepos
 	GList *dapps;
 	DockappNode *_dapp = NULL;
 
+	if( ! IS_PANELOFF(wmdock) )
+		return NULL;
+
 	prim = (dapp == wmdock_get_primary_anchor_dockapp()) ? TRUE : FALSE;
 
 	switch(wmdock->anchorPos) {
 	/* Remove not possible snap positions for the dragging dockapp. */
 	case ANCHOR_TR:
-		possible^= (GLUE_T | GLUE_L);
+		possible^= (GLUE_T | GLUE_R);
 		possible^= prim == TRUE ? GLUE_R : 0;
 		break;
 	case ANCHOR_BR:
@@ -127,7 +131,7 @@ static DockappNode *wmdock_get_snapable_dockapp(DockappNode *dapp, gint *gluepos
 		possible^= prim == TRUE ? GLUE_L: 0;
 		break;
 	case ANCHOR_TL:
-		possible^= (GLUE_T | GLUE_R);
+		possible^= (GLUE_T | GLUE_L);
 		possible^= prim == TRUE ? GLUE_L : 0;
 		break;
 	case ANCHOR_BL:
@@ -170,6 +174,9 @@ static void wmdock_remove_anchors_tile_dummy()
 	GList *dapps;
 	DockappNode *_dapp = NULL;
 
+	if( ! IS_PANELOFF(wmdock) )
+		return;
+
 	dapps = g_list_first(wmdock->dapps);
 	while(dapps) {
 		if((_dapp = DOCKAPP(dapps->data))) {
@@ -197,6 +204,9 @@ static gboolean wmdock_replace_tile_dummy(DockappNode *dapp)
 	GList *dapps;
 	DockappNode *_dapp = NULL, *parent = NULL, *_parent = NULL;
 
+	if( ! IS_PANELOFF(wmdock) )
+		return FALSE;
+
 	parent = wmdock_get_parent_dockapp(dapp);
 	if(!parent && wmdock_get_primary_anchor_dockapp() == dapp) {
 		/* Set the nearest dockapp to parent if the current dapp is primary.
@@ -257,6 +267,9 @@ static gboolean wmdock_replace_tile_dummy(DockappNode *dapp)
  */
 static void wmdock_dockapp_button_press_handler(GtkWidget *window, GdkEventButton *ev, DockappNode *dapp)
 {
+	if( ! IS_PANELOFF(wmdock) )
+		return;
+
 	debug("dockapp.c: Window button press event (dapp: `%s')", dapp->name);
 	dappOnMotion = dapp;
 	motionstartx = (gint) ev->x;
@@ -275,6 +288,9 @@ static void wmdock_dockapp_button_press_handler(GtkWidget *window, GdkEventButto
  */
 static void wmdock_dockapp_button_release_handler(GtkWidget *window, GdkEventButton *ev, DockappNode *dapp)
 {
+	if( ! IS_PANELOFF(wmdock) )
+		return;
+
 	debug("dockapp.c: Window button release event (dapp: `%s')", dapp->name);
 	if(wmdock_replace_tile_dummy(dapp) == TRUE) {
 		debug("dockapp.c: Replaceable dummy tile found.");
@@ -289,7 +305,7 @@ static void wmdock_dockapp_button_release_handler(GtkWidget *window, GdkEventBut
 
 	dappOnMotion = NULL;
 	gtk_window_set_keep_above(GTK_WINDOW(dapp->tile), FALSE);
-	gtk_window_set_keep_below(GTK_WINDOW(dapp->tile), TRUE);
+	gtk_window_set_keep_below(GTK_WINDOW(dapp->tile), wmdock->propPanelOffKeepAbove == TRUE ? FALSE : TRUE);
 }
 
 
@@ -306,6 +322,9 @@ static void wmdock_dockapp_motion_notify_handler(GtkWidget *window, GdkEventMoti
 	DockappNode *dappSnap = NULL;
 	GdkModifierType m;
 
+	if( ! IS_PANELOFF(wmdock) )
+		return;
+
 	debug("dockapp.c: Window motion notify event (dapp: `%s')", dapp->name);
 
 	gdk_window_get_pointer(dapp->tile->window, &x, &y, &m);
@@ -397,6 +416,9 @@ DockappNode *wmdock_get_primary_anchor_dockapp()
 	GList *dapps1, *dapps2;
 	DockappNode *dapp1 = NULL, *dapp2 = NULL;
 
+	if( ! IS_PANELOFF(wmdock) )
+		return NULL;
+
 	dapps1 = g_list_first(wmdock->dapps);
 
 	while(dapps1) {
@@ -439,8 +461,11 @@ DockappNode *wmdock_get_primary_anchor_dockapp()
  */
 void wmdock_dockapp_event_after_handler(GtkWidget *window, GdkEvent *ev, DockappNode *dapp)
 {
-	debug("dockapp.c: Window event-after: %d. (dapp: `%s'), dappOnMove: %s", ev->type, dapp->name,
-			dappOnMotion ? "Yes": "No");
+	if( ! IS_PANELOFF(wmdock) )
+		return;
+
+	debug("dockapp.c: Window event-after: %d. (dapp: `%s'), dappOnMove: %s", ev->type, dapp->name, dappOnMotion ? "Yes": "No");
+
 	switch(ev->type) {
 	case GDK_FOCUS_CHANGE:
 		if(ev->focus_change.in == TRUE) {
@@ -466,6 +491,9 @@ GtkWidget *wmdock_create_tile_dummy()
 {
 	GtkWidget *dummy = NULL;
 
+	if( ! IS_PANELOFF(wmdock) )
+		return NULL;
+
 	dummy = gtk_window_new(GTK_WINDOW_TOPLEVEL);
 
 	gtk_window_set_default_size(GTK_WINDOW(dummy), DEFAULT_DOCKAPP_WIDTH,
@@ -499,10 +527,10 @@ void wmdock_dockapp_tofront(DockappNode *dapp) {
 		return;
 
 	if ( IS_PANELOFF(wmdock) ) {
-		gtk_window_set_keep_below(GTK_WINDOW(dapp->tile), FALSE);
+		gtk_window_set_keep_below(GTK_WINDOW(dapp->tile), wmdock->propPanelOffKeepAbove == TRUE ? FALSE : TRUE);
 		gdk_window_raise(dapp->tile->window);
 		gtk_window_set_keep_above(GTK_WINDOW(dapp->tile), FALSE);
-		gtk_window_set_keep_below(GTK_WINDOW(dapp->tile), TRUE);
+		gtk_window_set_keep_below(GTK_WINDOW(dapp->tile), wmdock->propPanelOffKeepAbove == TRUE ? FALSE : TRUE);
 	}
 }
 
@@ -530,7 +558,7 @@ void wmdock_destroy_dockapp(DockappNode *dapp)
 
 void wmdock_setupdnd_dockapp(DockappNode *dapp)
 {
-	if( ! IS_PANELOFF(wmdock)) {
+	if( ! IS_PANELOFF(wmdock) ) {
 		/* Make the "well label" a DnD destination. */
 		gtk_drag_dest_set (GTK_WIDGET(dapp->s), GTK_DEST_DEFAULT_MOTION, targetList,
 				nTargets, GDK_ACTION_MOVE);
@@ -646,10 +674,9 @@ void wmdock_free_dockapp(DockappNode *dapp)
 		wmdock_panel_draw_wmdock_icon(FALSE);
 	}
 
-	if( IS_PANELOFF(wmdock) && g_list_first(wmdock->dapps))
-		wmdock_order_dockapps(DOCKAPP(g_list_first(wmdock->dapps)->data));
-
 	wmdock_refresh_properties_dialog();
+	if ( IS_PANELOFF(wmdock) )
+		wmdock_order_dockapps(wmdock_get_primary_anchor_dockapp());
 }
 
 
@@ -710,6 +737,9 @@ DockappNode *wmdock_get_parent_dockapp(DockappNode *dapp)
 	GList *dapps;
 	DockappNode *_dapp;
 
+	if (! IS_PANELOFF(wmdock) )
+		return NULL;
+
 	dapps = g_list_first(wmdock->dapps);
 
 	while(dapps) {
@@ -836,7 +866,7 @@ GtkWidget *wmdock_create_tile_from_socket(DockappNode *dapp)
 		gtk_container_set_border_width(GTK_CONTAINER(tile), 0);
 		/* To disable dragging by alt key. */
 		gtk_window_set_type_hint(GTK_WINDOW(tile), GDK_WINDOW_TYPE_HINT_DOCK);
-		gtk_window_set_keep_below(GTK_WINDOW(tile), TRUE);
+		gtk_window_set_keep_below(GTK_WINDOW(tile), wmdock->propPanelOffKeepAbove == TRUE ? FALSE : TRUE);
 		gtk_window_set_keep_above(GTK_WINDOW(tile), FALSE);
 
 		/* Disable window shrinking resizing and growing. */
@@ -874,7 +904,7 @@ void wmdock_set_autoposition_dockapp(DockappNode *dapp, DockappNode *prevDapp)
 	gint x, y, i, offsetx, offsety, gluepos = GLUE_MAX;
 	XfceScreenPosition xfceScrPos;
 
-	if(! IS_PANELOFF(wmdock) || !dapp )
+	if(! IS_PANELOFF(wmdock) || !dapp || blockDappReorder == TRUE)
 		return;
 
 	/* Setup the position of the first dockapp. */
@@ -910,14 +940,16 @@ void wmdock_set_autoposition_dockapp(DockappNode *dapp, DockappNode *prevDapp)
 			offsetx = offsety = 0;
 			switch(wmdock->anchorPos) {
 			case ANCHOR_TL:
-				if(xfceScrPos == XFCE_SCREEN_POSITION_NW_V ||
+				if((xfceScrPos == XFCE_SCREEN_POSITION_NW_V ||
 						xfceScrPos == XFCE_SCREEN_POSITION_W ||
-						xfceScrPos == XFCE_SCREEN_POSITION_SW_V) {
+						xfceScrPos == XFCE_SCREEN_POSITION_SW_V) &&
+						wmdock->propPanelOffIgnoreOffset == FALSE) {
 					offsetx = panelx == 0 ? xfce_panel_plugin_get_size(wmdock->plugin) + 1 : 0;
 					offsety = 0;
-				} else if (xfceScrPos == XFCE_SCREEN_POSITION_NW_H ||
+				} else if ((xfceScrPos == XFCE_SCREEN_POSITION_NW_H ||
 						xfceScrPos == XFCE_SCREEN_POSITION_N ||
-						xfceScrPos == XFCE_SCREEN_POSITION_NE_H) {
+						xfceScrPos == XFCE_SCREEN_POSITION_NE_H) &&
+						wmdock->propPanelOffIgnoreOffset == FALSE) {
 					offsetx = 0;
 					offsety = panely == 0 ? xfce_panel_plugin_get_size(wmdock->plugin) + 1 : 0;
 				}
@@ -926,14 +958,16 @@ void wmdock_set_autoposition_dockapp(DockappNode *dapp, DockappNode *prevDapp)
 				y = 0 + offsety;
 				break;
 			case ANCHOR_TR:
-				if(xfceScrPos == XFCE_SCREEN_POSITION_NE_V ||
+				if((xfceScrPos == XFCE_SCREEN_POSITION_NE_V ||
 						xfceScrPos == XFCE_SCREEN_POSITION_E ||
-						xfceScrPos == XFCE_SCREEN_POSITION_SE_V) {
+						xfceScrPos == XFCE_SCREEN_POSITION_SE_V) &&
+						wmdock->propPanelOffIgnoreOffset == FALSE) {
 					offsetx = xfce_panel_plugin_get_size(wmdock->plugin) + 1;
 					offsety = 0;
-				} else if (xfceScrPos == XFCE_SCREEN_POSITION_NW_H ||
+				} else if ((xfceScrPos == XFCE_SCREEN_POSITION_NW_H ||
 						xfceScrPos == XFCE_SCREEN_POSITION_N ||
-						xfceScrPos == XFCE_SCREEN_POSITION_NE_H) {
+						xfceScrPos == XFCE_SCREEN_POSITION_NE_H) &&
+						wmdock->propPanelOffIgnoreOffset == FALSE) {
 					offsetx = 0;
 					offsety = panely == 0 ? xfce_panel_plugin_get_size(wmdock->plugin) + 1 : 0;
 				}
@@ -942,14 +976,16 @@ void wmdock_set_autoposition_dockapp(DockappNode *dapp, DockappNode *prevDapp)
 				y = 0 + offsety;
 				break;
 			case ANCHOR_BL:
-				if(xfceScrPos == XFCE_SCREEN_POSITION_NW_V ||
+				if((xfceScrPos == XFCE_SCREEN_POSITION_NW_V ||
 						xfceScrPos == XFCE_SCREEN_POSITION_W ||
-						xfceScrPos == XFCE_SCREEN_POSITION_SW_V) {
+						xfceScrPos == XFCE_SCREEN_POSITION_SW_V) &&
+						wmdock->propPanelOffIgnoreOffset == FALSE) {
 					offsetx = panelx == 0 ? xfce_panel_plugin_get_size(wmdock->plugin) + 1 : 0;
 					offsety = 0;
-				} else if (xfceScrPos == XFCE_SCREEN_POSITION_SW_H ||
+				} else if ((xfceScrPos == XFCE_SCREEN_POSITION_SW_H ||
 						xfceScrPos == XFCE_SCREEN_POSITION_S ||
-						xfceScrPos == XFCE_SCREEN_POSITION_SE_H) {
+						xfceScrPos == XFCE_SCREEN_POSITION_SE_H) &&
+						wmdock->propPanelOffIgnoreOffset == FALSE) {
 					offsetx = 0;
 					offsety = xfce_panel_plugin_get_size(wmdock->plugin) + 1;
 				}
@@ -958,14 +994,16 @@ void wmdock_set_autoposition_dockapp(DockappNode *dapp, DockappNode *prevDapp)
 				y = gdk_screen_get_height(get_current_gdkscreen()) - DEFAULT_DOCKAPP_HEIGHT - offsety;
 				break;
 			case ANCHOR_BR:
-				if(xfceScrPos == XFCE_SCREEN_POSITION_NE_V ||
+				if((xfceScrPos == XFCE_SCREEN_POSITION_NE_V ||
 						xfceScrPos == XFCE_SCREEN_POSITION_E ||
-						xfceScrPos == XFCE_SCREEN_POSITION_SE_V) {
+						xfceScrPos == XFCE_SCREEN_POSITION_SE_V) &&
+						wmdock->propPanelOffIgnoreOffset == FALSE) {
 					offsetx = xfce_panel_plugin_get_size(wmdock->plugin) + 1;
 					offsety = 0;
-				} else if (xfceScrPos == XFCE_SCREEN_POSITION_SW_H ||
+				} else if ((xfceScrPos == XFCE_SCREEN_POSITION_SW_H ||
 						xfceScrPos == XFCE_SCREEN_POSITION_S ||
-						xfceScrPos == XFCE_SCREEN_POSITION_SE_H) {
+						xfceScrPos == XFCE_SCREEN_POSITION_SE_H) &&
+						wmdock->propPanelOffIgnoreOffset == FALSE) {
 					offsetx = 0;
 					offsety = xfce_panel_plugin_get_size(wmdock->plugin) + 1;
 				}
@@ -980,6 +1018,7 @@ void wmdock_set_autoposition_dockapp(DockappNode *dapp, DockappNode *prevDapp)
 			}
 		} /* else */
 	}
+
 	gtk_window_move(GTK_WINDOW(dapp->tile), x, y);
 
 	debug("dockapp.c: %d, Panel posx: %d, Panel posy: %d, Plug posx: %d, Plug posy: %d, prevDapp: %s, movex: %d, movey: %d",
@@ -997,7 +1036,7 @@ void wmdock_order_dockapps(DockappNode *dapp)
 {
 	gint i;
 
-	if(! IS_PANELOFF(wmdock) || !dapp )
+	if(! IS_PANELOFF(wmdock) || !dapp || blockDappReorder == TRUE)
 		return;
 
 	for(i = 0; i < GLUE_MAX; i++) {
@@ -1009,3 +1048,71 @@ void wmdock_order_dockapps(DockappNode *dapp)
 			wmdock_order_dockapps(dapp->glue[i]);
 	}
 }
+
+
+/**
+ * Function swap all anchors for the new startup position.
+ *
+ * @param AnchorPostion The new postion startup anchor postion.
+ */
+void wmdock_set_new_anchorpos(AnchorPostion newAnchorPos)
+{
+	GList *dapps = NULL;
+	DockappNode *_dapp = NULL, *_glue = NULL;
+	gboolean swapLeftRight = FALSE, swapTopBottom = FALSE;
+
+	if (! IS_PANELOFF(wmdock) || newAnchorPos == wmdock->anchorPos)
+		return;
+
+	blockDappReorder = TRUE; /* Temporary disable dockapp reordering. */
+	for(dapps = g_list_first(wmdock->dapps); dapps; dapps = g_list_next(dapps)) {
+		_dapp = DOCKAPP(dapps->data);
+		switch(newAnchorPos) {
+		case ANCHOR_TL:
+			if(wmdock->anchorPos == ANCHOR_TR || wmdock->anchorPos == ANCHOR_BR)
+				/* Swap from left to right. */
+				swapLeftRight = TRUE;
+			if(wmdock->anchorPos == ANCHOR_BL || wmdock->anchorPos == ANCHOR_BR)
+				/* Swap from bottom to top. */
+				swapTopBottom = TRUE;
+			break;
+		case ANCHOR_TR:
+			if(wmdock->anchorPos == ANCHOR_TL || wmdock->anchorPos == ANCHOR_BL)
+				/* Swap from left to right. */
+				swapLeftRight = TRUE;
+			if(wmdock->anchorPos == ANCHOR_BL || wmdock->anchorPos == ANCHOR_BR)
+				/* Swap from bottom to top. */
+				swapTopBottom = TRUE;
+			break;
+		case ANCHOR_BL:
+			if(wmdock->anchorPos == ANCHOR_TR || wmdock->anchorPos == ANCHOR_BR)
+				/* Swap from left to right. */
+				swapLeftRight = TRUE;
+			if(wmdock->anchorPos == ANCHOR_TL || wmdock->anchorPos == ANCHOR_TR)
+				/* Swap from bottom to top. */
+				swapTopBottom = TRUE;
+			break;
+		default: /* ANCHOR_BR */
+			if(wmdock->anchorPos == ANCHOR_TL || wmdock->anchorPos == ANCHOR_BL)
+				/* Swap from left to right. */
+				swapLeftRight = TRUE;
+			if(wmdock->anchorPos == ANCHOR_TL || wmdock->anchorPos == ANCHOR_TR)
+				/* Swap from bottom to top. */
+				swapTopBottom = TRUE;
+			break;
+		}
+
+		if(swapLeftRight == TRUE) {
+			_glue = _dapp->glue[GLUE_L];
+			_dapp->glue[GLUE_L] = _dapp->glue[GLUE_R];
+			_dapp->glue[GLUE_R] = _glue;
+		}
+		if(swapTopBottom == TRUE) {
+			_glue = _dapp->glue[GLUE_T];
+			_dapp->glue[GLUE_T] = _dapp->glue[GLUE_B];
+			_dapp->glue[GLUE_B] = _glue;
+		}
+	}
+
+	blockDappReorder = FALSE;
+}
diff --git a/panel-plugin/dockapp.h b/panel-plugin/dockapp.h
index 4e5a886..7bf4283 100644
--- a/panel-plugin/dockapp.h
+++ b/panel-plugin/dockapp.h
@@ -70,6 +70,7 @@ void wmdock_dockapp_tofront(DockappNode *dapp);
 void wmdock_dockapp_event_after_handler(GtkWidget *, GdkEvent *, DockappNode *);
 void wmdock_remove_anchor_dockapp(DockappNode *, DockappNode *);
 void wmdock_order_dockapps(DockappNode *);
+void wmdock_set_new_anchorpos(AnchorPostion);
 GtkWidget *wmdock_create_tile_dummy();
 gint wmdock_get_default_gluepos();
 gint wmdock_get_glue_position(gchar const *);
diff --git a/panel-plugin/props.c b/panel-plugin/props.c
index f20892d..6bc7f04 100644
--- a/panel-plugin/props.c
+++ b/panel-plugin/props.c
@@ -41,18 +41,19 @@
 
 /* Properties dialog */
 static struct {
-	GtkWidget *dlg;
-	GtkWidget *vbox, *vbox2, *vboxGeneral, *vboxDetect;
-	GtkWidget *hbox, *hboxPanelOffOpts;
-	GtkWidget *frmGeneral, *frmDetect, *frmPanelOffOpts;
-	GtkWidget *lblSel, *lblCmd;
-	GtkWidget *chkDispTile, *chkPropButton, *chkAddOnlyWM, *chkPanelOff;
-	GtkWidget *radioPanelOffTL, *radioPanelOffTR, *radioPanelOffBL, *radioPanelOffBR;
-	GtkWidget *imageContainer, *container;
-	GtkWidget *imageTile, *image;
-	GtkWidget *txtCmd;
-	GtkWidget *cbx;
-	GtkWidget *btnMoveUp, *btnMoveDown, *txtPatterns;
+	GtkWidget *dlg; /* Dialogs */
+	GtkWidget *vbox, *vbox2, *vboxGeneral, *vboxDetect, *vboxPanelOffOpts; /* Vertical boxes */
+	GtkWidget *hbox, *hboxPanelOffOpts; /* Horizontal boxes */
+	GtkWidget *frmGeneral, *frmDetect, *frmPanelOffOpts; /* Frames */
+	GtkWidget *lblSel, *lblCmd, *lblPanelOffPlacement; /* Labels */
+	GtkWidget *chkDispTile, *chkPropButton, *chkAddOnlyWM, *chkPanelOff, *chkPanelOffIgnoreOffset, *chkPanelOffKeepAbove; /* Check boxes */
+	GtkWidget *radioPanelOffTL, *radioPanelOffTR, *radioPanelOffBL, *radioPanelOffBR; /* Radio buttons */
+	GtkWidget *imageContainer, *container; /* Misc. containers */
+	GtkWidget *tblPanelOff; /* Layout tables */
+	GtkWidget *imageTile, *image; /* Images */
+	GtkWidget *txtCmd, *txtPatterns; /* Text boxes */
+	GtkWidget *cbx; /* Combo boxes */
+	GtkWidget *btnMoveUp, *btnMoveDown; /* Misc. buttons */
 } prop;
 
 static GtkWidget *btnProperties = NULL;
@@ -104,19 +105,59 @@ static void wmdock_properties_chkaddonlywm(GtkToggleButton *gtkChkAddOnlyWM, gpo
 }
 
 
+static void wmdock_properties_chkpaneloffignoreoffset(GtkToggleButton *gtkChkPanelOffIgnoreOffset, gpointer user_data)
+{
+	wmdock->propPanelOffIgnoreOffset = gtk_toggle_button_get_active(gtkChkPanelOffIgnoreOffset);
+	wmdock_order_dockapps(wmdock_get_primary_anchor_dockapp());
+}
+
+
+static void wmdock_properties_chkpaneloffkeepabove(GtkToggleButton *gtkChkPanelOffKeepAbove, gpointer user_data)
+{
+	wmdock->propPanelOffKeepAbove = gtk_toggle_button_get_active(gtkChkPanelOffKeepAbove);
+	g_list_foreach(wmdock->dapps, (GFunc) wmdock_dockapp_tofront, NULL);
+}
+
+
+static void wmdock_properties_radiopaneloff(GtkRadioButton *gtkRadioPanelOff, gpointer user_data)
+{
+	gint _anchorPos = wmdock->anchorPos;
+
+	if(gtkRadioPanelOff == GTK_RADIO_BUTTON(prop.radioPanelOffTL))
+		_anchorPos = ANCHOR_TL;
+	else if(gtkRadioPanelOff == GTK_RADIO_BUTTON(prop.radioPanelOffTR))
+		_anchorPos = ANCHOR_TR;
+	else if(gtkRadioPanelOff == GTK_RADIO_BUTTON(prop.radioPanelOffBL))
+		_anchorPos = ANCHOR_BL;
+	else if(gtkRadioPanelOff == GTK_RADIO_BUTTON(prop.radioPanelOffBR))
+		_anchorPos = ANCHOR_BR;
+
+	wmdock_set_new_anchorpos(_anchorPos);
+	wmdock->anchorPos = _anchorPos;
+	wmdock_order_dockapps(wmdock_get_primary_anchor_dockapp());
+}
+
+
 static void wmdock_properties_chkpaneloff(GtkToggleButton *gtkChkPanelOff, gpointer user_data)
 {
 	GtkWidget *gtkDlg;
 
 	if((rcPanelOff = gtk_toggle_button_get_active(gtkChkPanelOff)) == TRUE) {
-		wmdock->anchorPos = xfce_panel_plugin_get_screen_position(wmdock->plugin);
-		gtk_widget_set_sensitive(GTK_WIDGET(prop.frmPanelOffOpts), TRUE);
+		wmdock->anchorPos = get_default_anchor_postion();
+		gtk_widget_set_sensitive(GTK_WIDGET(prop.radioPanelOffBL), TRUE);
+		gtk_widget_set_sensitive(GTK_WIDGET(prop.radioPanelOffBR), TRUE);
+		gtk_widget_set_sensitive(GTK_WIDGET(prop.radioPanelOffTL), TRUE);
+		gtk_widget_set_sensitive(GTK_WIDGET(prop.radioPanelOffTR), TRUE);
+		gtk_widget_set_sensitive(GTK_WIDGET(prop.lblPanelOffPlacement), TRUE);
 	} else {
-		gtk_widget_set_sensitive(GTK_WIDGET(prop.frmPanelOffOpts), FALSE);
+		gtk_widget_set_sensitive(GTK_WIDGET(prop.radioPanelOffBL), FALSE);
+		gtk_widget_set_sensitive(GTK_WIDGET(prop.radioPanelOffBR), FALSE);
+		gtk_widget_set_sensitive(GTK_WIDGET(prop.radioPanelOffTL), FALSE);
+		gtk_widget_set_sensitive(GTK_WIDGET(prop.radioPanelOffTR), FALSE);
+		gtk_widget_set_sensitive(GTK_WIDGET(prop.lblPanelOffPlacement), FALSE);
 	}
 
 	if(g_list_length(wmdock->dapps)) {
-
 		gtkDlg = gtk_message_dialog_new(GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (wmdock->plugin))),
 				GTK_DIALOG_DESTROY_WITH_PARENT,
 				GTK_MESSAGE_INFO,
@@ -384,16 +425,17 @@ void wmdock_properties_dialog(XfcePanelPlugin *plugin)
 
 	prop.frmGeneral = gtk_frame_new(_("General settings"));
 	prop.frmDetect = gtk_frame_new(_("Dockapp detection"));
-	prop.frmPanelOffOpts = gtk_frame_new(_("Alignment options"));
+	prop.frmPanelOffOpts = gtk_frame_new(_("Mode settings"));
 	prop.vboxGeneral = gtk_vbox_new(FALSE, 6);
 	prop.vboxDetect = gtk_vbox_new(FALSE, 6);
+	prop.vboxPanelOffOpts = gtk_vbox_new(FALSE, 6);
 
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (prop.dlg)->vbox), prop.frmGeneral,
-			FALSE, FALSE, 0);
-	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (prop.dlg)->vbox), prop.frmDetect,
-			FALSE, FALSE, 0);
+	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (prop.dlg)->vbox), prop.frmGeneral, FALSE, FALSE, 0);
+	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (prop.dlg)->vbox), prop.frmDetect, FALSE, FALSE, 0);
+	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (prop.dlg)->vbox), prop.frmPanelOffOpts, FALSE, FALSE, 0);
 	gtk_container_set_border_width (GTK_CONTAINER (prop.vboxGeneral), 4);
 	gtk_container_set_border_width (GTK_CONTAINER (prop.vboxDetect), 4);
+	gtk_container_set_border_width (GTK_CONTAINER (prop.vboxPanelOffOpts), 4);
 
 	prop.vbox = gtk_vbox_new(FALSE, 4);
 	prop.vbox2 = gtk_vbox_new(FALSE, 4);
@@ -403,16 +445,13 @@ void wmdock_properties_dialog(XfcePanelPlugin *plugin)
 	gtk_box_pack_start (GTK_BOX (prop.hbox), prop.vbox2, FALSE, FALSE, 0);
 
 	prop.imageContainer = gtk_alignment_new(0.5, 0.5, 0, 0);
-	gtk_widget_set_size_request(GTK_WIDGET(prop.imageContainer),
-			DEFAULT_DOCKAPP_WIDTH,
-			DEFAULT_DOCKAPP_HEIGHT);
+	gtk_widget_set_size_request(GTK_WIDGET(prop.imageContainer), DEFAULT_DOCKAPP_WIDTH, DEFAULT_DOCKAPP_HEIGHT);
 	prop.container =  gtk_fixed_new();
 
 	prop.hboxPanelOffOpts = gtk_hbox_new(FALSE, 4);
 
 	/* Create the GTK widget objects. */
-	gdkPbIcon = gdk_pixbuf_new_from_xpm_data((const char**)
-			xfce4_wmdock_plugin_xpm);
+	gdkPbIcon = gdk_pixbuf_new_from_xpm_data((const char**) xfce4_wmdock_plugin_xpm);
 
 	prop.imageTile = gtk_image_new_from_pixbuf(gdkPbTileDefault);
 	prop.image = gtk_image_new_from_pixbuf (gdkPbIcon);
@@ -423,18 +462,14 @@ void wmdock_properties_dialog(XfcePanelPlugin *plugin)
 	gtk_container_add(GTK_CONTAINER(prop.container), prop.imageTile);
 	gtk_container_add(GTK_CONTAINER(prop.container), prop.imageContainer);
 
-
-	gtk_box_pack_start (GTK_BOX(prop.vbox), GTK_WIDGET (prop.container),
-			FALSE, FALSE, 0);
+	gtk_box_pack_start (GTK_BOX(prop.vbox), GTK_WIDGET (prop.container), FALSE, FALSE, 0);
 
 	prop.btnMoveUp = xfce_arrow_button_new (GTK_ARROW_UP);
 	prop.btnMoveDown = xfce_arrow_button_new (GTK_ARROW_DOWN);
 
 	if(!IS_PANELOFF(wmdock)) {
-		gtk_box_pack_start (GTK_BOX(prop.vbox), GTK_WIDGET (prop.btnMoveUp), FALSE,
-				FALSE, 0);
-		gtk_box_pack_start (GTK_BOX(prop.vbox), GTK_WIDGET (prop.btnMoveDown), FALSE,
-				FALSE, 0);
+		gtk_box_pack_start (GTK_BOX(prop.vbox), GTK_WIDGET (prop.btnMoveUp), FALSE, FALSE, 0);
+		gtk_box_pack_start (GTK_BOX(prop.vbox), GTK_WIDGET (prop.btnMoveDown), FALSE, FALSE, 0);
 	}
 
 	prop.lblSel = gtk_label_new (_("Select dockapp to configure:"));
@@ -457,76 +492,101 @@ void wmdock_properties_dialog(XfcePanelPlugin *plugin)
 	}
 	gtk_box_pack_start (GTK_BOX(prop.vbox2), prop.txtCmd, FALSE, FALSE, 0);
 
-	prop.chkDispTile   = gtk_check_button_new_with_label(_("Display tile in the background."));
-	prop.chkPropButton = gtk_check_button_new_with_label(_("Display a separate WMdock properties\nbutton in the panel."));
-	prop.chkAddOnlyWM  = gtk_check_button_new_with_label(_("Add only dockapps which start with\npattern in list. (e.g.: ^wm;^as)"));
-	prop.chkPanelOff   = gtk_check_button_new_with_label(_("Don't use the XFCE panel for the dockapps."));
-	prop.txtPatterns   = gtk_entry_new();
+	prop.chkDispTile             = gtk_check_button_new_with_label(_("Display tile in the background."));
+	prop.chkPropButton           = gtk_check_button_new_with_label(_("Display a separate WMdock properties button in the panel."));
+	prop.chkAddOnlyWM            = gtk_check_button_new_with_label(_("Add only dockapps which start with pattern in list. (e.g.: ^wm;^as)"));
+	prop.chkPanelOff             = gtk_check_button_new_with_label(_("Display dockapps in separate windows and not in the panel."));
+	prop.chkPanelOffIgnoreOffset = gtk_check_button_new_with_label(_("Don't use panel size as offset for the first dockapp."));
+	prop.chkPanelOffKeepAbove    = gtk_check_button_new_with_label(_("Keep dockapp windows on top."));
+	prop.txtPatterns    = gtk_entry_new();
 	gtk_entry_set_text(GTK_ENTRY(prop.txtPatterns), wmdock->filterList);
-	gtk_widget_set_sensitive (GTK_WIDGET (prop.txtPatterns),
-			wmdock->propDispAddOnlyWM);
+	gtk_widget_set_sensitive (GTK_WIDGET (prop.txtPatterns), wmdock->propDispAddOnlyWM);
 
-	gtk_toggle_button_set_active((GtkToggleButton *) prop.chkDispTile,
-			wmdock->propDispTile);
-	gtk_toggle_button_set_active((GtkToggleButton *) prop.chkPropButton,
-			wmdock->propDispPropButton);
-	gtk_toggle_button_set_active((GtkToggleButton *) prop.chkAddOnlyWM,
-			wmdock->propDispAddOnlyWM);
-	gtk_toggle_button_set_active((GtkToggleButton *) prop.chkPanelOff,
-			rcPanelOff);
+	gtk_toggle_button_set_active((GtkToggleButton *) prop.chkDispTile, wmdock->propDispTile);
+	gtk_toggle_button_set_active((GtkToggleButton *) prop.chkPropButton, wmdock->propDispPropButton);
+	gtk_toggle_button_set_active((GtkToggleButton *) prop.chkAddOnlyWM, wmdock->propDispAddOnlyWM);
+	gtk_toggle_button_set_active((GtkToggleButton *) prop.chkPanelOff, rcPanelOff);
+	gtk_toggle_button_set_active((GtkToggleButton *) prop.chkPanelOffIgnoreOffset, wmdock->propPanelOffIgnoreOffset);
+	gtk_toggle_button_set_active((GtkToggleButton *) prop.chkPanelOffKeepAbove, wmdock->propPanelOffKeepAbove);
 
 	gtk_container_add(GTK_CONTAINER(prop.frmGeneral), prop.vboxGeneral);
 	gtk_container_add(GTK_CONTAINER(prop.frmDetect), prop.vboxDetect);
-
-	gtk_box_pack_start (GTK_BOX(prop.vboxGeneral), prop.chkPanelOff,
-			FALSE, FALSE, 0);
-	gtk_box_pack_start (GTK_BOX(prop.vboxGeneral), prop.frmPanelOffOpts,
-			FALSE, FALSE, 0);
-	gtk_box_pack_start (GTK_BOX(prop.vboxGeneral), prop.chkDispTile,
-			FALSE, FALSE, 0);
-	gtk_box_pack_start (GTK_BOX(prop.vboxGeneral), prop.chkPropButton,
-			FALSE, FALSE, 0);
-	gtk_box_pack_start (GTK_BOX(prop.vboxDetect), prop.chkAddOnlyWM,
-			FALSE, FALSE, 0);
-	gtk_box_pack_start (GTK_BOX(prop.vboxDetect), prop.txtPatterns,
-			FALSE, FALSE, 0);
-
-	/* Setup advanced panel off mode options frame. */
+	gtk_container_add(GTK_CONTAINER(prop.frmPanelOffOpts), prop.vboxPanelOffOpts);
+
+	gtk_box_pack_start (GTK_BOX(prop.vboxGeneral), prop.frmPanelOffOpts, FALSE, FALSE, 0);
+	gtk_box_pack_start (GTK_BOX(prop.vboxGeneral), prop.chkDispTile, FALSE, FALSE, 0);
+	gtk_box_pack_start (GTK_BOX(prop.vboxGeneral), prop.chkPropButton, FALSE, FALSE, 0);
+	gtk_box_pack_start (GTK_BOX(prop.vboxDetect), prop.chkAddOnlyWM, FALSE, FALSE, 0);
+	gtk_box_pack_start (GTK_BOX(prop.vboxDetect), prop.txtPatterns, FALSE, FALSE, 0);
+
+	/* Setup panel off mode options frame. */
+	gtk_box_pack_start (GTK_BOX(prop.vboxPanelOffOpts), prop.chkPanelOff, FALSE, FALSE, 0);
+	gtk_box_pack_start (GTK_BOX (prop.vboxPanelOffOpts), prop.chkPanelOffKeepAbove, FALSE, FALSE, 0);
+	gtk_box_pack_start (GTK_BOX (prop.vboxPanelOffOpts), prop.chkPanelOffIgnoreOffset, FALSE, FALSE, 0);
+	gtk_box_pack_start (GTK_BOX(prop.vboxPanelOffOpts), prop.hboxPanelOffOpts, FALSE, FALSE, 0);
+
+	prop.tblPanelOff = gtk_table_new(2, 2, TRUE);
+	prop.lblPanelOffPlacement = gtk_label_new (_("Startup placement:"));
+	gtk_misc_set_alignment (GTK_MISC (prop.lblPanelOffPlacement), 0, 0);
 	prop.radioPanelOffTL = gtk_radio_button_new_with_label(NULL, _("Top left"));
 	prop.radioPanelOffTR = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(prop.radioPanelOffTL), _("Top right"));
 	prop.radioPanelOffBL = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(prop.radioPanelOffTL), _("Bottom left"));
 	prop.radioPanelOffBR = gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(prop.radioPanelOffTL), _("Bottom right"));
 
-	gtk_container_add(GTK_CONTAINER(prop.frmPanelOffOpts), prop.hboxPanelOffOpts);
-	gtk_box_pack_start (GTK_BOX (prop.hboxPanelOffOpts), prop.radioPanelOffTL,
-				FALSE, FALSE, 0);
-	gtk_box_pack_start (GTK_BOX (prop.hboxPanelOffOpts), prop.radioPanelOffTR,
-				FALSE, FALSE, 0);
-	gtk_box_pack_start (GTK_BOX (prop.hboxPanelOffOpts), prop.radioPanelOffBL,
-				FALSE, FALSE, 0);
-	gtk_box_pack_start (GTK_BOX (prop.hboxPanelOffOpts), prop.radioPanelOffBR,
-				FALSE, FALSE, 0);
+	gtk_box_pack_start (GTK_BOX (prop.hboxPanelOffOpts), prop.lblPanelOffPlacement, FALSE, FALSE, 0);
+	gtk_box_pack_start (GTK_BOX (prop.hboxPanelOffOpts), prop.tblPanelOff, FALSE, FALSE, 0);
+	gtk_table_attach_defaults(GTK_TABLE(prop.tblPanelOff), prop.radioPanelOffTL, 0, 1, 0, 1);
+	gtk_table_attach_defaults(GTK_TABLE(prop.tblPanelOff), prop.radioPanelOffTR, 1, 2, 0, 1);
+	gtk_table_attach_defaults(GTK_TABLE(prop.tblPanelOff), prop.radioPanelOffBL, 0, 1, 1, 2);
+	gtk_table_attach_defaults(GTK_TABLE(prop.tblPanelOff), prop.radioPanelOffBR, 1, 2, 1, 2);
+	/*
+	gtk_box_pack_start (GTK_BOX (prop.hboxPanelOffOpts), prop.radioPanelOffTL, FALSE, FALSE, 0);
+	gtk_box_pack_start (GTK_BOX (prop.hboxPanelOffOpts), prop.radioPanelOffTR, FALSE, FALSE, 0);
+	gtk_box_pack_start (GTK_BOX (prop.hboxPanelOffOpts), prop.radioPanelOffBL, FALSE, FALSE, 0);
+	gtk_box_pack_start (GTK_BOX (prop.hboxPanelOffOpts), prop.radioPanelOffBR, FALSE, FALSE, 0);
+	*/
+	switch(wmdock->anchorPos) {
+	case ANCHOR_TL:
+		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(prop.radioPanelOffTL), TRUE);
+		break;
+	case ANCHOR_TR:
+		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(prop.radioPanelOffTR), TRUE);
+		break;
+	case ANCHOR_BL:
+		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(prop.radioPanelOffBL), TRUE);
+		break;
+	default:
+		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(prop.radioPanelOffBR), TRUE);
+		break;
+	}
+
+	if ( ! IS_PANELOFF(wmdock) ) {
+		/* Disable advanced panel options is the panel used. */
+		gtk_widget_set_sensitive(GTK_WIDGET(prop.radioPanelOffBL), FALSE);
+		gtk_widget_set_sensitive(GTK_WIDGET(prop.radioPanelOffBR), FALSE);
+		gtk_widget_set_sensitive(GTK_WIDGET(prop.radioPanelOffTL), FALSE);
+		gtk_widget_set_sensitive(GTK_WIDGET(prop.radioPanelOffTR), FALSE);
+		gtk_widget_set_sensitive(GTK_WIDGET(prop.lblPanelOffPlacement), FALSE);
+	}
 
 	/* Fill the dockapp chooser with entries. */
 	wmdock_refresh_properties_dialog();
 
 	/* Connect some signals to the dialog widgets */
-	g_signal_connect(G_OBJECT(prop.cbx), "changed",
-			G_CALLBACK(wmdock_properties_changed), prop.txtCmd);
-	g_signal_connect(G_OBJECT(prop.txtCmd), "key-release-event",
-			G_CALLBACK(wmdock_properties_savecmd), prop.cbx);
-	g_signal_connect(G_OBJECT(prop.btnMoveUp), "pressed",
-			G_CALLBACK(wmdock_properties_moveup), prop.cbx);
-	g_signal_connect(G_OBJECT(prop.btnMoveDown), "pressed",
-			G_CALLBACK(wmdock_properties_movedown), prop.cbx);
-	g_signal_connect(G_OBJECT(prop.chkDispTile), "toggled",
-			G_CALLBACK(wmdock_properties_chkdisptile), NULL);
-	g_signal_connect(G_OBJECT(prop.chkPanelOff), "toggled",
-			G_CALLBACK(wmdock_properties_chkpaneloff), NULL);
-	g_signal_connect(G_OBJECT(prop.chkPropButton), "toggled",
-			G_CALLBACK(wmdock_properties_chkpropbtn), NULL);
-	g_signal_connect(G_OBJECT(prop.chkAddOnlyWM), "toggled",
-			G_CALLBACK(wmdock_properties_chkaddonlywm), NULL);
+	g_signal_connect(G_OBJECT(prop.cbx), "changed", G_CALLBACK(wmdock_properties_changed), prop.txtCmd);
+	g_signal_connect(G_OBJECT(prop.txtCmd), "key-release-event", G_CALLBACK(wmdock_properties_savecmd), prop.cbx);
+	g_signal_connect(G_OBJECT(prop.btnMoveUp), "pressed", G_CALLBACK(wmdock_properties_moveup), prop.cbx);
+	g_signal_connect(G_OBJECT(prop.btnMoveDown), "pressed", G_CALLBACK(wmdock_properties_movedown), prop.cbx);
+	g_signal_connect(G_OBJECT(prop.chkDispTile), "toggled", G_CALLBACK(wmdock_properties_chkdisptile), NULL);
+	g_signal_connect(G_OBJECT(prop.chkPanelOff), "toggled", G_CALLBACK(wmdock_properties_chkpaneloff), NULL);
+	g_signal_connect(G_OBJECT(prop.chkPanelOffIgnoreOffset), "toggled", G_CALLBACK(wmdock_properties_chkpaneloffignoreoffset), NULL);
+	g_signal_connect(G_OBJECT(prop.chkPanelOffKeepAbove), "toggled", G_CALLBACK(wmdock_properties_chkpaneloffkeepabove), NULL);
+	g_signal_connect(G_OBJECT(prop.radioPanelOffTL), "toggled", G_CALLBACK(wmdock_properties_radiopaneloff), NULL);
+	g_signal_connect(G_OBJECT(prop.radioPanelOffTR), "toggled", G_CALLBACK(wmdock_properties_radiopaneloff), NULL);
+	g_signal_connect(G_OBJECT(prop.radioPanelOffBL), "toggled", G_CALLBACK(wmdock_properties_radiopaneloff), NULL);
+	g_signal_connect(G_OBJECT(prop.radioPanelOffBR), "toggled", G_CALLBACK(wmdock_properties_radiopaneloff), NULL);
+	g_signal_connect(G_OBJECT(prop.chkPropButton), "toggled", G_CALLBACK(wmdock_properties_chkpropbtn), NULL);
+	g_signal_connect(G_OBJECT(prop.chkAddOnlyWM), "toggled", G_CALLBACK(wmdock_properties_chkaddonlywm), NULL);
 
 	g_timeout_add (500, wmdock_properties_refresh_dapp_icon, NULL);
 
diff --git a/panel-plugin/rcfile.c b/panel-plugin/rcfile.c
index 034908c..1bd4bd5 100644
--- a/panel-plugin/rcfile.c
+++ b/panel-plugin/rcfile.c
@@ -72,6 +72,8 @@ void wmdock_read_rc_file (XfcePanelPlugin *plugin)
 	wmdock->filterList         = g_strdup(xfce_rc_read_entry (rc, RCKEY_DAFILTER, DOCKAPP_FILTER_PATTERN));
 	/* TODO: Set panel off to FALSE. */
 	rcPanelOff                 = wmdock->propPanelOff = xfce_rc_read_bool_entry (rc, RCKEY_PANELOFF, TRUE);
+	wmdock->propPanelOffIgnoreOffset = xfce_rc_read_bool_entry (rc, RCKEY_PANELOFFIGNOREOFFSET, FALSE);
+	wmdock->propPanelOffKeepAbove    = xfce_rc_read_bool_entry (rc, RCKEY_PANELOFFKEEPABOVE, FALSE);
 	glueList                   = IS_PANELOFF(wmdock) ? xfce_rc_read_list_entry(rc, RCKEY_GLUELIST, RC_LIST_DELIMITER) : NULL;
 	wmdock->anchorPos          = xfce_rc_read_int_entry(rc, RCKEY_ANCHORPOS, -1);
 	xfce_rc_close (rc);
@@ -124,12 +126,15 @@ void wmdock_read_rc_file (XfcePanelPlugin *plugin)
 
 		if( IS_PANELOFF( wmdock ) && g_strv_length(rcCmds) == g_strv_length(glueList) ) {
 			for (i = 0; glueList[i]; i++) {
-				if(!launched[i] || glueList[i][0] == '\0' || !(glueInfo = g_strsplit(glueList[i], RC_GLUE_DELIMITER, 0)))
+				if(!launched[i])
 					continue;
 
 				/* Cleanup the default anchors. */
 				memset(launched[i]->glue, '\0', sizeof(DockappNode *) * GLUE_MAX);
 
+				if(glueList[i][0] == '\0' || !(glueInfo = g_strsplit(glueList[i], RC_GLUE_DELIMITER, 0)))
+					continue;
+
 				for (j = 0; glueInfo[j]; j++) {
 					n = g_ascii_strtoll(glueInfo[j], &glueName, 10);
 					if(n > G_MAXINT || n < 0 || n > g_strv_length(rcCmds)-1 || glueName == glueInfo[j] || glueName[0] != ':')
@@ -209,6 +214,8 @@ void wmdock_write_rc_file (XfcePanelPlugin *plugin)
 		xfce_rc_write_bool_entry (rc, RCKEY_DISPPROPBTN, wmdock->propDispPropButton);
 		xfce_rc_write_bool_entry (rc, RCKEY_DISPADDONLYWM, wmdock->propDispAddOnlyWM);
 		xfce_rc_write_bool_entry (rc, RCKEY_PANELOFF, rcPanelOff);
+		xfce_rc_write_bool_entry (rc, RCKEY_PANELOFFIGNOREOFFSET, wmdock->propPanelOffIgnoreOffset);
+		xfce_rc_write_bool_entry (rc, RCKEY_PANELOFFKEEPABOVE, wmdock->propPanelOffKeepAbove);
 		xfce_rc_write_entry(rc, RCKEY_DAFILTER, wmdock->filterList);
 		xfce_rc_write_int_entry (rc, RCKEY_ANCHORPOS, wmdock->anchorPos);
 	}
diff --git a/panel-plugin/rcfile.h b/panel-plugin/rcfile.h
index 8ad48c6..637b5b3 100644
--- a/panel-plugin/rcfile.h
+++ b/panel-plugin/rcfile.h
@@ -23,15 +23,17 @@
 #ifndef __RCFILE_H__
 #define __RCFILE_H__
 
-#define RCKEY_CMDLIST       (const gchar *) "cmds"
-#define RCKEY_CMDCNT        (const gchar *) "cmdcnt"
-#define RCKEY_DISPTILE      (const gchar *) "disptile"
-#define RCKEY_DISPPROPBTN   (const gchar *) "disppropbtn"
-#define RCKEY_DISPADDONLYWM (const gchar *) "dispaddonlywm"
-#define RCKEY_PANELOFF      (const gchar *) "paneloff"
-#define RCKEY_DAFILTER      (const gchar *) "dafilter"
-#define RCKEY_ANCHORPOS     (const gchar *) "anchorpos"
-#define RCKEY_GLUELIST      (const gchar *) "glues"
+#define RCKEY_CMDLIST              (const gchar *) "cmds"
+#define RCKEY_CMDCNT               (const gchar *) "cmdcnt"
+#define RCKEY_DISPTILE             (const gchar *) "disptile"
+#define RCKEY_DISPPROPBTN          (const gchar *) "disppropbtn"
+#define RCKEY_DISPADDONLYWM        (const gchar *) "dispaddonlywm"
+#define RCKEY_PANELOFF             (const gchar *) "paneloff"
+#define RCKEY_PANELOFFIGNOREOFFSET (const gchar *) "paneloffignoreoffset"
+#define RCKEY_PANELOFFKEEPABOVE    (const gchar *) "paneloffkeepabove"
+#define RCKEY_DAFILTER             (const gchar *) "dafilter"
+#define RCKEY_ANCHORPOS            (const gchar *) "anchorpos"
+#define RCKEY_GLUELIST             (const gchar *) "glues"
 
 #define RC_LIST_DELIMITER   (const gchar *) ";"
 #define RC_GLUE_DELIMITER   (const gchar *) ","
diff --git a/panel-plugin/wmdock.c b/panel-plugin/wmdock.c
index 7ef194d..4b8bdc6 100644
--- a/panel-plugin/wmdock.c
+++ b/panel-plugin/wmdock.c
@@ -66,6 +66,9 @@ static void wmdock_orientation_changed (XfcePanelPlugin *plugin, GtkOrientation
 	xfce_hvbox_set_orientation ((XfceHVBox *) wmdock->box, orientation);
 	gtk_widget_show(GTK_WIDGET(wmdock->panelBox));
 	gtk_widget_show(GTK_WIDGET(wmdock->box));
+
+	if( IS_PANELOFF(wmdock) )
+		wmdock_order_dockapps(wmdock_get_primary_anchor_dockapp());
 }
 
 
@@ -92,9 +95,10 @@ static gboolean wmdock_size_changed (XfcePanelPlugin *plugin, int size)
 		gtk_widget_set_size_request (GTK_WIDGET (plugin), size, -1);
 	}
 
-	if(wmdockIcon) {
+	if(wmdockIcon)
 		wmdock_panel_draw_wmdock_icon(TRUE);
-	}
+	if( IS_PANELOFF(wmdock) )
+		wmdock_order_dockapps(wmdock_get_primary_anchor_dockapp());
 
 	return TRUE;
 }
@@ -131,8 +135,10 @@ static WmdockPlugin *wmdock_plugin_new (XfcePanelPlugin* plugin)
 	wmdock->propDispAddOnlyWM  = TRUE;
 	/* TODO: Set panel off to FALSE. */
 	wmdock->propPanelOff       = TRUE;
+	wmdock->propPanelOffIgnoreOffset = FALSE;
+	wmdock->propPanelOffKeepAbove    = FALSE;
 	wmdock->filterList         = g_strdup(DOCKAPP_FILTER_PATTERN);
-	wmdock->anchorPos          = ANCHOR_BR;
+	wmdock->anchorPos          = get_default_anchor_postion();
 
 	wmdock->eventBox = gtk_event_box_new ();
 	gtk_widget_show(GTK_WIDGET(wmdock->eventBox));
diff --git a/panel-plugin/wmdock.h b/panel-plugin/wmdock.h
index 2a2f480..69d056e 100644
--- a/panel-plugin/wmdock.h
+++ b/panel-plugin/wmdock.h
@@ -49,6 +49,8 @@ typedef struct {
  gboolean            propDispPropButton;
  gboolean            propDispAddOnlyWM;
  gboolean            propPanelOff;
+ gboolean            propPanelOffIgnoreOffset;
+ gboolean            propPanelOffKeepAbove;
  AnchorPostion       anchorPos;
  gchar               *filterList;
 


More information about the Xfce4-commits mailing list