[Xfce4-commits] <xfce4-wmdock-plugin:master> Merge branch '0.6.x'

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


Updating branch refs/heads/master
         to eccf7135e742064d8e977c2986f3297dcafa5771 (commit)
       from cab1da9870909e384ff5b9a4576b4bad1ab66d35 (commit)

commit eccf7135e742064d8e977c2986f3297dcafa5771
Merge: cab1da9 aa8ff12
Author: Andre Ellguth <andre at ellguth.com>
Date:   Mon Nov 4 13:34:12 2013 +0100

    Merge branch '0.6.x'
    
    Conflicts:
    	po/ChangeLog
    	po/cs.po
    	po/fr.po
    	po/hu.po
    	po/id.po
    	po/it.po
    	po/kk.po
    	po/pt.po
    	po/pt_BR.po
    	po/ru.po
    	po/ug.po
    	po/uk.po
    	po/zh_CN.po

commit aa8ff12a50d752143361eacbd5248bbd2dd76998
Author: Andre Ellguth <andre at ellguth.com>
Date:   Tue Oct 22 10:14:25 2013 +0200

    Fixed a initial mapping bug off dockapps at startup.

commit c762a294086615bb4c46fc9a4345e98d244782ca
Author: Andre Ellguth <andre at ellguth.com>
Date:   Sun Oct 20 23:20:51 2013 +0200

    Removed autogenerated changelog messages.

commit 712c783097ed6e4af54577c04ac1a75c46edaa31
Author: Andre Ellguth <andre at ellguth.com>
Date:   Sun Oct 20 22:32:46 2013 +0200

    Updated current po files complied with the new source.
    Update ChangeLog for version 0.6.0.

commit 3012db5d8421b7fc95b16d17062ed11996d053cd
Author: Andre Ellguth <andre at ellguth.com>
Date:   Sun Oct 20 21:50:16 2013 +0200

    Added an additional detection of dockapps.

commit cf8c5aded86146c98266e04db982933ff9dd6373
Author: Andre Ellguth <andre at ellguth.com>
Date:   Fri Oct 18 19:35:30 2013 +0200

    Fixed some bugs detected with valgrind.
    Some dockapp detection changes.

commit 492cf84ee4cbf44dc760d48ed4df999fc4e49a92
Author: Andre Ellguth <andre at ellguth.com>
Date:   Thu Oct 17 23:00:48 2013 +0200

    Free positioning of first dockapp now working. Fixed some bugs trigger panel on/off.

commit 1dc25d2ff953e6869df442a27e0a0f347730c23d
Author: Andre Ellguth <andre at ellguth.com>
Date:   Wed Oct 16 19:41:40 2013 +0200

    Begin to add a option to enable free positioning of the first dockapp.

commit 489ca0e314640548c9f604493a19406df8334427
Author: Andre Ellguth <andre at ellguth.com>
Date:   Wed Oct 16 10:56:10 2013 +0200

    Set the tile window style equal to the XFCE panel style.

commit 6329390ff4ca61ddd353423885664126bf8509dd
Author: Andre Ellguth <andre at ellguth.com>
Date:   Wed Oct 16 08:26:45 2013 +0200

    Changed authors email address.

commit 43d217bb9c6e6c9c19e6a2dfa285c524a4ed09a3
Author: Andre Ellguth <andre at ellguth.com>
Date:   Tue Oct 15 22:38:21 2013 +0200

    Fixed a dnd bug in panel mode. Draw a minimal preview of dockapp if dockapp is dragged.

commit c1a214c7e557370e87bb3164d43748155793d392
Author: Andre Ellguth <andre at ellguth.com>
Date:   Tue Oct 15 15:01:40 2013 +0200

    Fix some draw glitches in panel mode (I hope).

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.

commit cf255cb4dffd80d4dea7a5d9a4495d9d2d54009b
Author: Andre Ellguth <andre at ellguth.com>
Date:   Fri Oct 11 17:39:36 2013 +0200

    Disabled the posibilty to drag the dockapp by pressing the ALT key.
    Enabled motion dragging for smaller dockapps (less than 64 pixels).

commit 7ee37205b7cc23156e9d02b1622adaa193a96b2b
Author: Andre Ellguth <andre at ellguth.com>
Date:   Thu Oct 10 21:58:10 2013 +0200

    Replace dockapps if the resolution is changed.

commit 609eb8096e79a5d8c13b2377585a5a77d852c058
Author: Andre Ellguth <andre at ellguth.com>
Date:   Wed Oct 9 23:55:58 2013 +0200

    Fixed some bugs at dockapp restore.

commit 79f73db43ddd64ac4224286ef9abc53f526dd898
Author: Andre Ellguth <andre at ellguth.com>
Date:   Tue Oct 8 18:22:17 2013 +0200

    Implemented restoring dockapp postion from rc file.

commit db7f29c982e45760ae35feb31ac2993f5c7524a4
Author: Andre Ellguth <andre at ellguth.com>
Date:   Sun Oct 6 17:45:40 2013 +0200

    Write the dockapp postions in panel off mode to rc file.

commit f6da1dc354d06d901c97b82f56a27e3171c5fc18
Author: Andre Ellguth <andre at ellguth.com>
Date:   Wed Oct 2 18:31:46 2013 +0200

    Some changes for rc startup and dockapp placement.

commit b55aaf8bcf20cd68c0349023b40cd972794580d4
Author: Andre Ellguth <andre at ellguth.com>
Date:   Tue Oct 1 18:01:14 2013 +0200

    Code cleanup.
    Some changes for rc startup.

commit 2cb7071d1af48b065f8e46e279d6586806b3736e
Author: Andre Ellguth <andre at ellguth.com>
Date:   Mon Sep 30 18:37:52 2013 +0200

    Implementation of dockapp movement via event handler.

commit d3e1aec12fe7f64c24a0c86ec352c04fc2d988c8
Author: Andre Ellguth <andre at ellguth.com>
Date:   Fri Sep 27 18:04:18 2013 +0200

    Fixed background tile glitch.
    Some improvments for the dockapp movement.

commit 42838e22732a9bfa8097079df3e78e65bf4495ae
Author: Andre Ellguth <andre at ellguth.com>
Date:   Thu Sep 26 21:57:54 2013 +0200

    Some changes on dockapp background drawing.

commit a5a23d4397b58043b04917f9139adbf66735f624
Author: Andre Ellguth <andre at ellguth.com>
Date:   Fri Sep 20 18:41:05 2013 +0200

    Added alignment options for the panel off mode.
    Integrated the new anchor postions.

commit 62926768568bf222739c07aebc2480f4895a36b2
Author: Andre Ellguth <andre at ellguth.com>
Date:   Thu Sep 19 18:55:17 2013 +0200

    Fixed some strange bugs in the dockapp movement (panel off mode).

commit 4804e72540e692132c9552c60a7fcdd3844f85eb
Author: Andre Ellguth <andre at ellguth.com>
Date:   Fri Jul 26 15:27:54 2013 +0200

    Revert last changes in the child_pos function.

commit 7a84bda4c709e999685df8e18b405dd2ba1a0b49
Merge: cdf7e9a fba72d1
Author: Andre Ellguth <andre at ellguth.com>
Date:   Fri Jul 26 15:27:09 2013 +0200

    Merge branch '0.6.x' of ssh://git.xfce.org/panel-plugins/xfce4-wmdock-plugin into 0.6.x

commit cdf7e9afa8e61995d0433651baa64c4a1405e06d
Author: Andre Ellguth <andre at ellguth.com>
Date:   Thu Jul 25 22:00:01 2013 +0200

    Revert to commit d6edfaef1d343f3471cb09318fdfb07e07a3df7b.

commit fba72d122d62bef5ba896c42e09dffa936eaf19b
Author: Andre Ellguth <andre at ellguth.com>
Date:   Thu Jul 25 21:31:42 2013 +0200

    Some changes for the dockapp movement.

commit d6edfaef1d343f3471cb09318fdfb07e07a3df7b
Author: Andre Ellguth <andre at ellguth.com>
Date:   Thu Jul 25 18:45:27 2013 +0200

    Some Dockapp movement bug fixes.

commit bed00b923287a5a7d0a3f3fa3eea56ce4c4d5369
Author: Andre Ellguth <andre at ellguth.com>
Date:   Wed Jul 24 22:44:31 2013 +0200

    Get the correct screen of the plugin.
    Correct some bugs for the dockapp movement.

commit 72d1dc630750645d7741f4755dbc727eb973b0ea
Author: Andre Ellguth <andre at ellguth.com>
Date:   Tue Jul 23 20:52:56 2013 +0200

    Some work for the dockapp movement.

commit df03e90a64c1883f54a240029a5ea2832c36771b
Author: Andre Ellguth <andre at ellguth.com>
Date:   Mon Jul 22 20:54:19 2013 +0200

    Some changes to the dockapp movement.

commit 46586bf9fa10c33273a9066341516825f45e2798
Author: Andre Ellguth <andre at ellguth.com>
Date:   Mon Jul 22 18:43:36 2013 +0200

    Some work on the dockapp movement.

commit cc4a1e0fd1a4a67e2adb757e50e6020b066549e5
Author: Andre Ellguth <andre at ellguth.com>
Date:   Fri Jul 19 23:59:00 2013 +0200

    Some changes for the DockApp movement.

commit 59a627add3b45886ba8d76b8fb40a2f1cbed6e6c
Author: Andre Ellguth <andre at ellguth.com>
Date:   Thu Jul 18 22:30:39 2013 +0200

    Working on the implementation of panel off dockapp movement.

commit dfca92e3613b7d672ca8d6c6b18ebee73103c83e
Author: Andre Ellguth <andre at ellguth.com>
Date:   Thu Apr 4 21:20:50 2013 +0200

    Added a function to get the current display on which is wmdock located.

commit 15016d8b2b5ec0910f6771d7badfdfa06b1150cf
Author: Andre Ellguth <andre at ellguth.com>
Date:   Sun Aug 26 20:14:12 2012 +0200

    Exit multiple instances cleanly.

commit 4f0105bab613e65956c8d41c628cd6066fa8f77d
Author: Andre Ellguth <andre at ellguth.com>
Date:   Thu Aug 16 20:52:15 2012 +0200

    Check if only one instance of the plugin is run.

commit d66211cd85bef1987b619e78838a3148c3b794ec
Author: Andre Ellguth <andre at ellguth.com>
Date:   Wed Aug 15 21:19:17 2012 +0200

    Raise all dockapps in panel off if the panel icon is clicked.
    Fixed problem on startup.

commit 75271cfaf36dd3b8b6d9a92019b1129d581b47d7
Author: Andre Ellguth <andre at ellguth.com>
Date:   Wed Aug 15 12:39:27 2012 +0200

    Removed the svn keywords.
    Increased the version in the configure.in.in.
    Added the new files in the Makefile.am.

commit 28cb3b0aa6d8ac01d1fdcf5e457861cc1277050b
Author: Andre Ellguth <andre at ellguth.com>
Date:   Wed Aug 15 11:38:37 2012 +0200

    Added the newest developer branch with the new panel off mode.

 AUTHORS                                  |    4 +-
 ChangeLog                                |    7 +
 Makefile.am                              |    2 +-
 configure.in.in                          |    2 +-
 panel-plugin/Makefile.am                 |   15 +
 panel-plugin/catchwindow.c               |  256 ++++++
 panel-plugin/{wmdock.h => catchwindow.h} |   43 +-
 panel-plugin/debug.c                     |   74 ++
 panel-plugin/{wmdock.h => debug.h}       |   46 +-
 panel-plugin/dnd.c                       |  184 ++++
 panel-plugin/{wmdock.h => dnd.h}         |   50 +-
 panel-plugin/dockapp.c                   | 1151 +++++++++++++++++++++++
 panel-plugin/dockapp.h                   |   79 ++
 panel-plugin/{wmdock.h => extern.h}      |   50 +-
 panel-plugin/misc.c                      |  331 +++++++
 panel-plugin/{wmdock.h => misc.h}        |   60 +-
 panel-plugin/props.c                     |  604 +++++++++++++
 panel-plugin/{wmdock.h => props.h}       |   48 +-
 panel-plugin/rcfile.c                    |  235 +++++
 panel-plugin/rcfile.h                    |   59 ++
 panel-plugin/wmdock.c                    | 1455 +++---------------------------
 panel-plugin/wmdock.h                    |   53 +-
 po/ChangeLog                             |   54 ++
 po/POTFILES.in                           |   17 +
 po/ast.po                                |  114 ++-
 po/ca.po                                 |  114 ++-
 po/da.po                                 |  113 ++-
 po/de.po                                 |  113 ++-
 po/el.po                                 |  116 ++-
 po/en_GB.po                              |  114 ++-
 po/eu.po                                 |  113 ++-
 po/gl.po                                 |  120 ++-
 po/ja.po                                 |  112 ++-
 po/lv.po                                 |  113 ++-
 po/sv.po                                 |  113 ++-
 po/ur.po                                 |  113 ++-
 po/ur_PK.po                              |  113 ++-
 37 files changed, 4471 insertions(+), 1889 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index e0e8ce7..e0ff738 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -1,3 +1,3 @@
-Andre Ellguth <ellguth at ibh.de>
+Andre Ellguth <andre at ellguth.com>
 
-Some code inspiration from bdock and xfce4-eyes-plugin
\ No newline at end of file
+Some code inspiration from bdock and xfce4-eyes-plugin.
diff --git a/ChangeLog b/ChangeLog
index 6213f11..e934aa5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-10-20	Andre Ellguth <andre at ellguth dot com>
+	* Added a complete new mode without using the Xfce panel (panel off mode).
+	* Added many options for the new panel off mode.
+	* Fixed some background glitches.
+	* Split source into separate files
+	* Many bugfixes and improvments
+
 2011-04-29	Andre Ellguth <ellguth at ibh dot de>
 	* New editable dockapp filter.
 	* Added build support for XFCE 4.8.
diff --git a/Makefile.am b/Makefile.am
index 431aae4..e3a7df5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -10,7 +10,7 @@ AUTOMAKE_OPTIONS =							\
 distclean-local:
 	rm -rf *.cache *~ .project .settings .cdtproject
 
-EXTRA_DIST = config.rpath m4/ChangeLog 								\
+EXTRA_DIST = config.rpath  config.rpath m4/ChangeLog 								\
 	intltool-extract.in						\
 	intltool-merge.in						\
 	intltool-update.in
diff --git a/configure.in.in b/configure.in.in
index 3fe241e..8f0d2b1 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -5,7 +5,7 @@ dnl
 dnl
 
 dnl version info
-m4_define([wmdock_version], [0.3.4])
+m4_define([wmdock_version], [0.6.0])
 
 dnl init autoconf
 AC_INIT([xfce4-wmdock-plugin], [wmdock_version])
diff --git a/panel-plugin/Makefile.am b/panel-plugin/Makefile.am
index 96b3ff0..5ce2e84 100644
--- a/panel-plugin/Makefile.am
+++ b/panel-plugin/Makefile.am
@@ -2,7 +2,22 @@ plugindir = $(libexecdir)/xfce4/panel-plugins
 plugin_PROGRAMS = xfce4-wmdock-plugin
 
 xfce4_wmdock_plugin_SOURCES =						\
+	catchwindow.h							\
+	catchwindow.c							\
+	debug.h								\
+	debug.c								\
+	dnd.h								\
+	dnd.c								\
+	dockapp.h							\
+	dockapp.c							\
+	misc.h								\
+	misc.c								\
+	props.h								\
+	props.c								\
+	rcfile.h							\
+	rcfile.c							\
 	wmdock.h							\
+	extern.h							\
 	xfce4-wmdock-plugin.xpm						\
 	tile.xpm							\
 	wmdock.c
diff --git a/panel-plugin/catchwindow.c b/panel-plugin/catchwindow.c
new file mode 100644
index 0000000..c600c34
--- /dev/null
+++ b/panel-plugin/catchwindow.c
@@ -0,0 +1,256 @@
+/* wmdock xfce4 plugin by Andre Ellguth
+ * Catch the window if is a dockapp.
+ *
+ * Authors:
+ *   Andre Ellguth <andre at ellguth.com>
+ *
+ * License:
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this package; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <X11/Xatom.h>
+#include <X11/Xutil.h>
+
+#define WNCK_I_KNOW_THIS_IS_UNSTABLE
+#include <libwnck/libwnck.h>
+
+#include <gtk/gtk.h>
+#include <libxfce4util/libxfce4util.h>
+#include <libxfcegui4/libxfcegui4.h>
+#include <libxfce4panel/libxfce4panel.h>
+
+#include "extern.h"
+#include "catchwindow.h"
+#include "wmdock.h"
+#include "debug.h"
+#include "dockapp.h"
+#include "misc.h"
+#include "props.h"
+
+
+static gchar *wmdock_get_dockapp_cmd(WnckWindow *w)
+{
+	gchar *cmd = NULL;
+	int wpid = 0;
+	int argc = 0;
+	int fcnt, i;
+	char **argv;
+	FILE *procfp = NULL;
+	char buf[BUF_MAX];
+
+	XGetCommand(GDK_DISPLAY_XDISPLAY(get_current_gdkdisplay()),
+			wnck_window_get_xid(w), &argv, &argc);
+	if(argc > 0) {
+		argv = (char **) realloc(argv, sizeof(char *) * (argc + 1));
+		argv[argc] = NULL;
+		cmd = g_strjoinv (" ", argv);
+		XFreeStringList(argv);
+	} else {
+		/* Try to get the command line from the proc fs. */
+		wpid = wnck_window_get_pid (w);
+
+		if(wpid) {
+			sprintf(buf, "/proc/%d/cmdline", wpid);
+
+			procfp = fopen(buf, "r");
+
+			if(procfp) {
+				fcnt = read(fileno(procfp), buf, BUF_MAX);
+
+				cmd = g_malloc(fcnt+2);
+				if(!cmd) return (NULL);
+
+				for(i = 0; i < fcnt; i++) {
+					if(buf[i] == 0)
+						*(cmd+i) = ' ';
+					else
+						*(cmd+i) = buf[i];
+				}
+				*(cmd+(i-1)) = 0;
+
+				fclose(procfp);
+			}
+		}
+	}
+
+	if(!cmd) {
+		/* If nothing helps fallback to the window name. */
+		cmd = g_strdup(wnck_window_get_name(w));
+	}
+
+	return(cmd);
+}
+
+
+void wmdock_window_open(WnckScreen *s, WnckWindow *w)
+{
+	int wi, he;
+	XWMHints *h            = NULL;
+	XWindowAttributes attr;
+	DockappNode *dapp      = NULL;
+	gchar *cmd             = NULL;
+	const char *wmclass    = NULL;
+	gboolean rcDapp        = FALSE;
+
+	gdk_error_trap_push();
+	gdk_flush();
+
+	h = XGetWMHints(GDK_DISPLAY_XDISPLAY(get_current_gdkdisplay()),
+			wnck_window_get_xid(w));
+
+	if(!h)
+		return;
+	wmclass = wnck_window_get_class_group(w) ? wnck_class_group_get_name(wnck_window_get_class_group(w)) : NULL;
+
+	if(h->initial_state == WithdrawnState ||
+			h->flags == (WindowGroupHint | StateHint | IconWindowHint) ||
+			has_dockapp_hint(w) == TRUE ||
+			(wmclass && !g_strcmp0(wmclass, "DockApp"))) {
+
+		debug("catchwindow.c: new wmapp open");
+		debug("catchwindow.c: New dockapp %s with xid: 0x%x pid: %u arrived sessid: %s",
+				wnck_window_get_name(w), wnck_window_get_xid(w),
+				wnck_window_get_pid(w), wnck_window_get_session_id(w));
+
+		cmd = wmdock_get_dockapp_cmd(w);
+
+		if(wmdock->propDispAddOnlyWM == TRUE &&
+				comp_dockapp_with_filterlist(wnck_window_get_name(w)) == FALSE &&
+				! (wmdock_find_startup_dockapp(cmd))) {
+			XFree(h);
+			return;
+		}
+
+		if(!cmd) {
+			XFree(h);
+			return;
+		}
+		debug("catchwindow.c: found cmd %s for window %s", cmd, wnck_window_get_name(w));
+		rcDapp = rcCmds && (dapp = wmdock_find_startup_dockapp(cmd)) ? TRUE : FALSE;
+
+		if(rcDapp == FALSE) {
+			debug("catchwindow.c: Create a new dapp window %s", wnck_window_get_name(w));
+
+			dapp = g_new0(DockappNode, 1);
+			dapp->s = GTK_SOCKET(gtk_socket_new());
+		}
+
+		if(h->initial_state == WithdrawnState && h->icon_window) {
+			debug("catchwindow.c: Initial_state: %d with icon of window %s", h->initial_state, wnck_window_get_name(w));
+			XUnmapWindow(GDK_DISPLAY_XDISPLAY(get_current_gdkdisplay()), wnck_window_get_xid(w));
+			dapp->i =h->icon_window;
+		} else {
+			debug("catchwindow.c: Initial_state: %d %s of window %s", h->initial_state, h->icon_window ? "with icon" : "no icon", wnck_window_get_name(w));
+			dapp->i = wnck_window_get_xid(w);
+		}
+
+		if(!XGetWindowAttributes(GDK_DISPLAY_XDISPLAY(get_current_gdkdisplay()), dapp->i, &attr)) {
+			wi = DEFAULT_DOCKAPP_WIDTH;
+			he = DEFAULT_DOCKAPP_HEIGHT;
+		} else {
+			wi = attr.width;
+			he = attr.height;
+		}
+
+		if(wi > DEFAULT_DOCKAPP_WIDTH || he > DEFAULT_DOCKAPP_HEIGHT) {
+			/* It seems to be no dockapp, because the width or the height of the
+			 * window a greater than 64 pixels. */
+			XMapWindow(GDK_DISPLAY_XDISPLAY(get_current_gdkdisplay()),
+					wnck_window_get_xid(w));
+			gtk_widget_destroy(GTK_WIDGET(dapp->s));
+			g_free(cmd);
+			g_free(dapp);
+			XFree(h);
+			return;
+		}
+
+		debug("catchwindow.c: New dockapp %s width: %d height: %d", wnck_window_get_name(w), wi, he);
+
+		gtk_widget_set_size_request(GTK_WIDGET(dapp->s), wi, he);
+		wnck_window_stick (w);
+		wnck_window_set_skip_tasklist (w, TRUE);
+		wnck_window_set_skip_pager (w, TRUE);
+
+		/* Set this property to skip the XFCE4 session manager. */
+		set_xsmp_support(w);
+
+		dapp->name = g_strdup(wnck_window_get_name(w));
+		dapp->cmd = cmd;
+		dapp->width = (gint) wi;
+		dapp->height = (gint) he;
+
+		if(wmdockIcon && !IS_PANELOFF(wmdock)) {
+			gtk_widget_destroy(wmdockIcon);
+			wmdockIcon = NULL;
+		}
+
+		if(rcDapp == FALSE) {
+			dapp->tile = wmdock_create_tile_from_socket(dapp);
+			/* Setup tile background. */
+			wmdock_set_tile_background(dapp, gdkPbTileDefault);
+
+			if( ! IS_PANELOFF(wmdock) ) {
+				/* Setup the DockApp in the XFCE-panel. */
+				gtk_box_pack_start(GTK_BOX(wmdock->box), dapp->tile, FALSE, FALSE, 0);
+			} else {
+				/* Setup the DockApp for the WindowMaker like style. */
+				gtk_widget_show_all(GTK_WIDGET(dapp->tile));
+				wmdock_set_autoposition_dockapp(dapp,
+						g_list_last(wmdock->dapps) ? g_list_last(wmdock->dapps)->data : NULL);
+			}
+
+			wmdock->dapps=g_list_append(wmdock->dapps, dapp);
+		} else {
+			/* Change the postion of the DockApp with the newly determined width and height of the window. */
+			wmdock_set_socket_postion(dapp, (DEFAULT_DOCKAPP_WIDTH - wi) / 2, (DEFAULT_DOCKAPP_HEIGHT - he) / 2);
+		}
+
+		gtk_socket_add_id(dapp->s, dapp->i);
+		gtk_widget_show_all(GTK_WIDGET(dapp->tile));
+
+		/* Cleanly unmap the original window. */
+		if(h->initial_state == WithdrawnState)
+			XUnmapWindow(GDK_DISPLAY_XDISPLAY(get_current_gdkdisplay()), wnck_window_get_xid(w));
+
+		g_signal_connect(dapp->s, "plug-removed", G_CALLBACK(wmdock_dapp_closed), dapp);
+
+		/* Setup drag & drop for the dockapps. */
+		g_list_foreach(wmdock->dapps, (GFunc) wmdock_setupdnd_dockapp, NULL);
+
+		/* Bring all dockapps to the front if a new one shown (panel off mode). */
+		g_list_foreach(wmdock->dapps, (GFunc) wmdock_dockapp_tofront, NULL);
+
+		if( IS_PANELOFF(wmdock) ) {
+			wmdock_order_dockapps(wmdock_get_primary_anchor_dockapp());
+
+			/* Setup the event-after handler for the window. */
+			g_signal_connect(G_OBJECT(dapp->tile), "event-after", G_CALLBACK(wmdock_dockapp_event_after_handler), dapp);
+		} else {
+			/* Setup the event-after handler for the eventbox to fix some glitches. */
+			g_signal_connect(G_OBJECT(dapp->evbox), "event-after", G_CALLBACK(wmdock_dockapp_event_after_handler), dapp);
+		}
+		/* Clear the noisy background. */
+		wmdock_redraw_dockapp(dapp);
+
+		wmdock_refresh_properties_dialog();
+	}
+
+	XFree(h);
+}
diff --git a/panel-plugin/wmdock.h b/panel-plugin/catchwindow.h
similarity index 51%
copy from panel-plugin/wmdock.h
copy to panel-plugin/catchwindow.h
index f8c42c9..b37b409 100644
--- a/panel-plugin/wmdock.h
+++ b/panel-plugin/catchwindow.h
@@ -1,9 +1,8 @@
 /* wmdock xfce4 plugin by Andre Ellguth
- *
- * $Id$
+ * catchwindow.h
  *
  * Authors:
- *   Andre Ellguth <ellguth at ibh.de>
+ *   Andre Ellguth <andre at ellguth.com>
  *
  * License:
  *   This program is free software; you can redistribute it and/or modify
@@ -21,40 +20,12 @@
  *   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-#ifndef __WMDOCK_H__
-#define __WMDOCK_H__
-
-#include <gtk/gtk.h>
-#include <libxfce4panel/libxfce4panel.h>
-
-#define WNCK_I_KNOW_THIS_IS_UNSTABLE
-#include <libwnck/libwnck.h>
-
-typedef struct _dockapp {
- GtkSocket       *s;
- GdkNativeWindow i;
- GtkWidget       *bg;
- GtkWidget       *tile;
- gchar           *name;
- gchar           *cmd;
-} DockappNode;
+#ifndef __CATCHWINDOW_H__
+#define __CATCHWINDOW_H__
 
-typedef struct {
- XfcePanelPlugin *plugin;
+/* Prototypes */
+void wmdock_window_open(WnckScreen *, WnckWindow *);
 
- GtkWidget       *eventBox;
-	
- /* Plugin specific definitions */
- GtkWidget       *align;
- GtkWidget       *box;
- GtkWidget       *panelBox;
-	
- gboolean        propDispTile;
- gboolean        propDispPropButton;
- gboolean        propDispAddOnlyWM;
- gchar           *filterList;
 
- GList           *dapps;
-} WmdockPlugin;
 
-#endif /* __WMDOCK_H__ */
+#endif /* __CATCHWINDOW_H__ */
diff --git a/panel-plugin/debug.c b/panel-plugin/debug.c
new file mode 100644
index 0000000..29e403a
--- /dev/null
+++ b/panel-plugin/debug.c
@@ -0,0 +1,74 @@
+/* wmdock xfce4 plugin by Andre Ellguth
+ * Debug output.
+ *
+ * Authors:
+ *   Andre Ellguth <andre at ellguth.com>
+ *
+ * License:
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this package; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <time.h>
+
+#include "debug.h"
+#include "wmdock.h"
+
+#if DEBUG
+static FILE *fp = (FILE *) NULL;
+#endif
+
+void init_debug()
+{
+#if DEBUG
+	char debugFile[BUF_MAX];
+
+	sprintf(debugFile, "%s/wmdock-debug.%d", g_get_tmp_dir(), getpid());
+	fp = fopen(debugFile, "w");
+	if(!fp) fp = stderr;
+
+	debug("debug.c: Debug initialized.");
+#endif
+}
+
+
+void debug(const char *format, ...)
+{
+#if DEBUG
+	char buf[BUF_MAX];
+	va_list args;
+	time_t curtime;
+	struct tm *loctime;
+
+	if(!fp) {
+		return;
+	}
+
+	va_start(args, format);
+    curtime = time (NULL);
+    loctime = localtime (&curtime);
+    strftime(buf, BUF_MAX, "%B %d %I:%M:%S", loctime);
+
+	fprintf(fp, "%s: ", buf);
+	vfprintf(fp, format, args);
+	fprintf(fp, "\n");
+	fflush(fp);
+
+	va_end(args);
+#endif /* DEBUG */
+}
+
+
diff --git a/panel-plugin/wmdock.h b/panel-plugin/debug.h
similarity index 50%
copy from panel-plugin/wmdock.h
copy to panel-plugin/debug.h
index f8c42c9..bdc9c23 100644
--- a/panel-plugin/wmdock.h
+++ b/panel-plugin/debug.h
@@ -1,9 +1,8 @@
 /* wmdock xfce4 plugin by Andre Ellguth
- *
- * $Id$
+ * debug.h
  *
  * Authors:
- *   Andre Ellguth <ellguth at ibh.de>
+ *   Andre Ellguth <andre at ellguth.com>
  *
  * License:
  *   This program is free software; you can redistribute it and/or modify
@@ -21,40 +20,11 @@
  *   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-#ifndef __WMDOCK_H__
-#define __WMDOCK_H__
-
-#include <gtk/gtk.h>
-#include <libxfce4panel/libxfce4panel.h>
-
-#define WNCK_I_KNOW_THIS_IS_UNSTABLE
-#include <libwnck/libwnck.h>
-
-typedef struct _dockapp {
- GtkSocket       *s;
- GdkNativeWindow i;
- GtkWidget       *bg;
- GtkWidget       *tile;
- gchar           *name;
- gchar           *cmd;
-} DockappNode;
-
-typedef struct {
- XfcePanelPlugin *plugin;
-
- GtkWidget       *eventBox;
-	
- /* Plugin specific definitions */
- GtkWidget       *align;
- GtkWidget       *box;
- GtkWidget       *panelBox;
-	
- gboolean        propDispTile;
- gboolean        propDispPropButton;
- gboolean        propDispAddOnlyWM;
- gchar           *filterList;
+#ifndef __DEBUG_H__
+#define __DEBUG_H__
 
- GList           *dapps;
-} WmdockPlugin;
+/* Prototypes */
+void init_debug();
+void debug(const char *, ...);
 
-#endif /* __WMDOCK_H__ */
+#endif /* __DEBUG_H__ */
diff --git a/panel-plugin/dnd.c b/panel-plugin/dnd.c
new file mode 100644
index 0000000..84e7ea1
--- /dev/null
+++ b/panel-plugin/dnd.c
@@ -0,0 +1,184 @@
+/* wmdock xfce4 plugin by Andre Ellguth
+ * Drag & Drop functions.
+ *
+ * Authors:
+ *   Andre Ellguth <andre at ellguth.com>
+ *
+ * License:
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this package; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <X11/Xatom.h>
+#include <X11/Xutil.h>
+
+#define WNCK_I_KNOW_THIS_IS_UNSTABLE
+#include <libwnck/libwnck.h>
+
+#include <gtk/gtk.h>
+#include <libxfce4util/libxfce4util.h>
+
+#include "extern.h"
+#include "wmdock.h"
+#include "debug.h"
+#include "dockapp.h"
+#include "misc.h"
+#include "dnd.h"
+
+#define _BYTE 8
+
+void drag_begin_handl (GtkWidget *widget, GdkDragContext *context,
+		gpointer dapp)
+{
+	GdkPixbuf *gdkPb = NULL, *gdkPbScaled = NULL;
+	gint width = 0, height = 0;
+
+	gtk_widget_get_size_request(GTK_WIDGET(DOCKAPP(dapp)->s), &width, &height);
+	if((gdkPb = gdk_pixbuf_get_from_drawable (NULL, GTK_WIDGET(DOCKAPP(dapp)->s)->window,
+			NULL, 0, 0, 0, 0, width, height))) {
+		gdkPbScaled = gdk_pixbuf_scale_simple(gdkPb, DEFAULT_DOCKAPP_WIDTH / 2, DEFAULT_DOCKAPP_HEIGHT / 2, GDK_INTERP_BILINEAR);
+		gtk_drag_set_icon_pixbuf (context, gdkPbScaled ? gdkPbScaled : gdkPb, 0, 0);
+
+		g_object_unref (G_OBJECT(gdkPb));
+		g_object_unref (G_OBJECT(gdkPbScaled));
+	}
+}
+
+#if (GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 12)
+gboolean drag_failed_handl(GtkWidget *widget, GdkDragContext *context,
+		GtkDragResult result, gpointer dapp)
+{
+	GtkWidget *gtkDlg = NULL;
+
+	if(result == GTK_DRAG_RESULT_NO_TARGET && dapp) {
+		gtkDlg = gtk_message_dialog_new(GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (wmdock->plugin))),
+				GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
+				GTK_MESSAGE_QUESTION,
+				GTK_BUTTONS_YES_NO,
+				_("Do you want remove the dockapp \"%s\"?"),
+				((DockappNode *) dapp)->name);
+
+		if(gtk_dialog_run (GTK_DIALOG(gtkDlg)) == GTK_RESPONSE_YES)
+			wmdock_destroy_dockapp((DockappNode *) dapp);
+
+		gtk_widget_destroy (GTK_WIDGET(gtkDlg));
+	}
+	debug("dnd.c: Drag failed of dockapp %s", ((DockappNode *) dapp)->name);
+
+	return TRUE;
+}
+#endif
+
+
+gboolean drag_drop_handl (GtkWidget *widget, GdkDragContext *context,
+		gint x, gint y, guint time, gpointer dapp)
+{
+	gboolean        is_valid_drop_site;
+	GdkAtom         target_type;
+
+	is_valid_drop_site = TRUE;
+
+	if (context-> targets)
+	{
+		target_type = GDK_POINTER_TO_ATOM
+				(g_list_nth_data (context-> targets, 0));
+
+		gtk_drag_get_data (widget,context, target_type, time);
+	}
+
+	else
+	{
+		is_valid_drop_site = FALSE;
+	}
+
+	return  is_valid_drop_site;
+}
+
+
+
+void drag_data_received_handl (GtkWidget *widget,
+		GdkDragContext *context, gint x, gint y,
+		GtkSelectionData *selection_data,
+		guint target_type, guint time,
+		gpointer dapp)
+{
+	glong *_idata;
+	gboolean dnd_success = FALSE;
+	GList *dappsSrc = NULL;
+	GList *dappsDst = NULL;
+
+	if(target_type == 0) {
+		_idata = (glong*) selection_data-> data;
+		debug("dnd.c: DnD integer received: %ld", *_idata);
+
+		dnd_success = TRUE;
+
+		if(dapp) {
+			dappsSrc = g_list_nth(wmdock->dapps, *_idata);
+			dappsDst = g_list_find(wmdock->dapps, (DockappNode *) dapp);
+
+			if(dappsSrc->data != dappsDst->data) {
+				debug("dnd.c: DnD src dockapp name: %s",
+						DOCKAPP(dappsSrc->data)->name);
+				debug("dnd.c: DnD dst dockapp name: %s",
+						DOCKAPP(dapp)->name);
+
+				dappsDst->data = dappsSrc->data;
+				dappsSrc->data = dapp;
+
+				debug("dnd.c: DnD src index: %d",
+						g_list_index (wmdock->dapps, dappsSrc->data));
+				debug("dnd.c: DnD dst index: %d",
+						g_list_index (wmdock->dapps, dappsDst->data));
+
+				gtk_box_reorder_child(GTK_BOX(wmdock->box),
+						GTK_WIDGET(DOCKAPP(dappsSrc->data)->tile),
+						g_list_index (wmdock->dapps, dappsSrc->data));
+				gtk_box_reorder_child(GTK_BOX(wmdock->box),
+						GTK_WIDGET(DOCKAPP(dappsDst->data)->tile),
+						g_list_index (wmdock->dapps, dappsDst->data));
+
+				g_list_foreach(wmdock->dapps, (GFunc)wmdock_redraw_dockapp, NULL);
+			}
+		}
+
+	}
+
+	gtk_drag_finish (context, dnd_success, FALSE, time);
+
+}
+
+
+
+void drag_data_get_handl (GtkWidget *widget, GdkDragContext *context,
+		GtkSelectionData *selection_data,
+		guint target_type, guint time,
+		gpointer dapp)
+{
+	gint index;
+
+	if(target_type == 0 && dapp) {
+		index = g_list_index (wmdock->dapps, (DockappNode *) dapp);
+
+		gtk_selection_data_set (selection_data, selection_data->target,
+				sizeof(index) * _BYTE,
+				(guchar*) &index, sizeof (index));
+
+		debug("dnd.c: DnD Integer sent: %ld", index);
+	}
+}
diff --git a/panel-plugin/wmdock.h b/panel-plugin/dnd.h
similarity index 50%
copy from panel-plugin/wmdock.h
copy to panel-plugin/dnd.h
index f8c42c9..a4ce608 100644
--- a/panel-plugin/wmdock.h
+++ b/panel-plugin/dnd.h
@@ -1,9 +1,8 @@
 /* wmdock xfce4 plugin by Andre Ellguth
- *
- * $Id$
+ * dnd.h
  *
  * Authors:
- *   Andre Ellguth <ellguth at ibh.de>
+ *   Andre Ellguth <andre at ellguth.com>
  *
  * License:
  *   This program is free software; you can redistribute it and/or modify
@@ -21,40 +20,15 @@
  *   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-#ifndef __WMDOCK_H__
-#define __WMDOCK_H__
-
-#include <gtk/gtk.h>
-#include <libxfce4panel/libxfce4panel.h>
-
-#define WNCK_I_KNOW_THIS_IS_UNSTABLE
-#include <libwnck/libwnck.h>
-
-typedef struct _dockapp {
- GtkSocket       *s;
- GdkNativeWindow i;
- GtkWidget       *bg;
- GtkWidget       *tile;
- gchar           *name;
- gchar           *cmd;
-} DockappNode;
-
-typedef struct {
- XfcePanelPlugin *plugin;
-
- GtkWidget       *eventBox;
-	
- /* Plugin specific definitions */
- GtkWidget       *align;
- GtkWidget       *box;
- GtkWidget       *panelBox;
-	
- gboolean        propDispTile;
- gboolean        propDispPropButton;
- gboolean        propDispAddOnlyWM;
- gchar           *filterList;
+#ifndef __DND_H__
+#define __DND_H__
 
- GList           *dapps;
-} WmdockPlugin;
+void drag_begin_handl (GtkWidget *, GdkDragContext *, gpointer);
+gboolean drag_drop_handl (GtkWidget *, GdkDragContext *, gint, gint, guint, gpointer);
+void drag_data_received_handl (GtkWidget *, GdkDragContext *, gint, gint, GtkSelectionData *, guint, guint, gpointer);
+void drag_data_get_handl (GtkWidget *, GdkDragContext *, GtkSelectionData *, guint, guint, gpointer);
+#if (GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 12)
+gboolean drag_failed_handl(GtkWidget *, GdkDragContext *, GtkDragResult, gpointer);
+#endif
 
-#endif /* __WMDOCK_H__ */
+#endif /* __DND_H__ */
diff --git a/panel-plugin/dockapp.c b/panel-plugin/dockapp.c
new file mode 100644
index 0000000..5045f3b
--- /dev/null
+++ b/panel-plugin/dockapp.c
@@ -0,0 +1,1151 @@
+/* wmdock xfce4 plugin by Andre Ellguth
+ * Dockapp handling.
+ *
+ * Authors:
+ *   Andre Ellguth <andre at ellguth.com>
+ *
+ * License:
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this package; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <X11/Xatom.h>
+#include <X11/Xutil.h>
+
+#define WNCK_I_KNOW_THIS_IS_UNSTABLE
+#include <libwnck/libwnck.h>
+
+#include <gtk/gtk.h>
+#include <libxfce4util/libxfce4util.h>
+#include <libxfcegui4/libxfcegui4.h>
+#include <libxfce4panel/libxfce4panel.h>
+
+#include "extern.h"
+#include "dockapp.h"
+#include "wmdock.h"
+#include "debug.h"
+#include "dnd.h"
+#include "misc.h"
+#include "rcfile.h"
+#include "props.h"
+
+#define DEFAULT_XPANEL_NAME "xfce4-panel"
+
+static GtkTargetEntry targetList[] = {
+		{ "INTEGER", 0, 0 }
+};
+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.
+ *
+ * @param dapp Parent dockapp.
+ * @param prevDapp Child dockapp.
+ * @param gluepos Orientation of the child dockapp.
+ * @param x Pointer to x.
+ * @param y Pointer to y.
+ */
+static void wmdock_dockapp_child_pos(DockappNode *prevDapp, gint gluepos, gint *x, gint *y)
+{
+	gint prevx, prevy;
+
+	/* Setup the position of the first dockapp. */
+	prevx = prevy = 0;
+
+	if(! IS_PANELOFF(wmdock) || !prevDapp)
+		return;
+
+	/* Get the position of the previous DockApp if is accessable. */
+	gtk_window_get_position(
+			GTK_WINDOW (GTK_WIDGET (prevDapp->tile)), &prevx, &prevy);
+
+	switch(gluepos) {
+	case GLUE_T:
+		*x = prevx;
+		*y = prevy - DEFAULT_DOCKAPP_HEIGHT;
+		break;
+	case GLUE_B:
+		*x = prevx;
+		*y = prevy + DEFAULT_DOCKAPP_HEIGHT;
+		break;
+	case GLUE_L:
+		*x = prevx - DEFAULT_DOCKAPP_WIDTH;
+		*y = prevy;
+		break;
+	case GLUE_R:
+		*x = prevx + DEFAULT_DOCKAPP_WIDTH;
+		*y = prevy;
+		break;
+	default:
+		break;
+	}
+}
+
+
+/**
+ * Calculate the next snapable postion of the moving DockApp.
+ *
+ * @parm dapp The moving DockApp.
+ * @parm gluepos Pointer to the glue position of the determined DockApp.
+ * @return The determined DockApp or NULL.
+ */
+static DockappNode *wmdock_get_snapable_dockapp(DockappNode *dapp, gint *gluepos)
+{
+#define SNAPDELTA (DEFAULT_DOCKAPP_HEIGHT/2)-1
+	gint posx, posy, gluex, gluey;
+	gint possible = GLUE_T | GLUE_B | GLUE_L | GLUE_R;
+	gboolean prim;
+	GList *dapps;
+	DockappNode *_dapp = NULL;
+
+	if( ! IS_PANELOFF(wmdock) )
+		return NULL;
+
+	posx = posy = gluex = gluey = 0;
+	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_R);
+		possible^= prim == TRUE ? GLUE_R : 0;
+		break;
+	case ANCHOR_BR:
+		possible^= (GLUE_B | GLUE_R);
+		possible^= prim == TRUE ? GLUE_L: 0;
+		break;
+	case ANCHOR_TL:
+		possible^= (GLUE_T | GLUE_L);
+		possible^= prim == TRUE ? GLUE_L : 0;
+		break;
+	case ANCHOR_BL:
+		possible^= (GLUE_B | GLUE_L);
+		possible^= prim == TRUE ? GLUE_R : 0;
+		break;
+	}
+
+	gtk_window_get_position(
+			GTK_WINDOW (GTK_WIDGET (dapp->tile)), &posx, &posy);
+
+	dapps = g_list_first(wmdock->dapps);
+
+	while(dapps) {
+		if((_dapp = DOCKAPP(dapps->data))) {
+			for(*gluepos = 0; *gluepos < GLUE_MAX; *gluepos=*gluepos+1) {
+				if((!_dapp->glue[*gluepos] || !g_strcmp0(_dapp->glue[*gluepos]->name, DOCKAPP_DUMMY_TITLE))
+						&& (possible & *gluepos)) {
+					wmdock_dockapp_child_pos(_dapp, *gluepos, &gluex, &gluey);
+					if(posx >= gluex-SNAPDELTA && posy >= gluey-SNAPDELTA &&
+							posx <= gluex+SNAPDELTA && posy <= gluey+SNAPDELTA)
+						return _dapp;
+				}
+			}
+		}
+
+		dapps = g_list_next(dapps);
+	}
+
+	return NULL;
+}
+
+
+/**
+ * Remove anchors of dummy DockApp.
+ */
+static void wmdock_remove_anchors_tile_dummy()
+{
+	gint i;
+	GList *dapps;
+	DockappNode *_dapp = NULL;
+
+	if( ! IS_PANELOFF(wmdock) )
+		return;
+
+	dapps = g_list_first(wmdock->dapps);
+	while(dapps) {
+		if((_dapp = DOCKAPP(dapps->data))) {
+			for(i = 0; i < GLUE_MAX; i++) {
+				if(_dapp->glue[i] && !g_strcmp0(_dapp->glue[i]->name, DOCKAPP_DUMMY_TITLE)) {
+					_dapp->glue[i] = NULL;
+				}
+			}
+		}
+
+		dapps = g_list_next(dapps);
+	}
+}
+
+
+/**
+ * Replace dummy DockApp with the moved DockApp.
+ *
+ * @param dapp Replacement dockapp.
+ * @return TRUE if dummy tile is replaced else FALSE.
+ */
+static gboolean wmdock_replace_tile_dummy(DockappNode *dapp)
+{
+	gint i, j;
+	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.
+		 * The nearest is the new primary dockapp. */
+		for(i = 0; i < GLUE_MAX; i++) {
+			if((parent = dapp->glue[i]))
+				break;
+		}
+	}
+	debug("dockapp.c: Parent DockApp of `%s' is `%s'", dapp->name, parent ? parent->name : "<none>");
+
+	dapps = g_list_first(wmdock->dapps);
+	while(dapps) {
+		if((_dapp = DOCKAPP(dapps->data))) {
+			for(i = 0; i < GLUE_MAX; i++) {
+				if(_dapp->glue[i] && !g_strcmp0(_dapp->glue[i]->name, DOCKAPP_DUMMY_TITLE)) {
+					g_list_foreach(wmdock->dapps, (GFunc) wmdock_remove_anchor_dockapp, dapp);
+					_dapp->glue[i] = dapp;
+					debug("dockapp.c: Connect `%s' to `%s' with glue.", dapp->name, _dapp->name);
+					for(j = 0; j < GLUE_MAX; j++) {
+						if(parent) {
+							if(parent == dapp->glue[j])
+								dapp->glue[j] = NULL;
+
+							/* Transfer all connected DockApps to the parent. */
+							_parent = parent;
+							while(_parent->glue[j] && _parent->glue[j] != dapp->glue[j]) {
+								_parent = _parent->glue[j];
+							}
+							if(dapp->glue[j] && _parent->glue[j] == dapp->glue[j]) {
+								debug("dockapp.c: Parent_Connect `%s' to `%s' with glue.", dapp->glue[j]->name, _parent->name);
+								continue;
+							}
+							_parent->glue[j] = dapp->glue[j];
+						}
+						/* Remove old anchor itself or all anchors it was the first anchor. */
+						dapp->glue[j] = NULL;
+					}
+
+					return TRUE;
+				}
+			}
+		}
+
+		dapps = g_list_next(dapps);
+	}
+
+	return FALSE;
+}
+
+
+/**
+ * Event handle for the tile in panel off mode (button_press)
+ *
+ * @param tile The window of the event.
+ * @param ev GdkEventButton.
+ * @param dapp DockAppNode of the event.
+ */
+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;
+	motionstarty = (gint) ev->y;
+	gtk_window_set_keep_above(GTK_WINDOW(dapp->tile), TRUE);
+	gtk_window_set_keep_below(GTK_WINDOW(dapp->tile), FALSE);
+}
+
+
+/**
+ * Event handle for the tile in panel off mode (button_release)
+ *
+ * @param tile The window of the event.
+ * @param ev GdkEventButton.
+ * @param dapp DockAppNode of the event.
+ */
+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.");
+		wmdock_order_dockapps(wmdock_get_primary_anchor_dockapp() ? wmdock_get_primary_anchor_dockapp() : dapp);
+	} else {
+		if(dapp == wmdock_get_primary_anchor_dockapp())
+			gtk_window_get_position(GTK_WINDOW(dapp->tile), &wmdock->panelOffFpX, &wmdock->panelOffFpY);
+		wmdock_remove_anchors_tile_dummy();
+		wmdock_set_autoposition_dockapp(dapp, wmdock_get_parent_dockapp(dapp));
+		if(dapp == wmdock_get_primary_anchor_dockapp())
+			wmdock_order_dockapps(dapp);
+	}
+	if(dappDummy) {
+		gtk_widget_hide(dappDummy->tile);
+	}
+
+	dappOnMotion = NULL;
+	gtk_window_set_keep_above(GTK_WINDOW(dapp->tile), FALSE);
+	gtk_window_set_keep_below(GTK_WINDOW(dapp->tile), wmdock->propPanelOffKeepAbove == TRUE ? FALSE : TRUE);
+}
+
+
+/**
+ * Event handle for the tile in panel off mode (motion_notify)
+ *
+ * @param tile The window of the event.
+ * @param ev GdkEventButton.
+ * @param dapp DockAppNode of the event.
+ */
+static void wmdock_dockapp_motion_notify_handler(GtkWidget *window, GdkEventMotion *ev, DockappNode *dapp)
+{
+	gint gluepos, x, y, posx, posy, movex, movey;
+	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);
+	if(window && dappOnMotion && (m & GDK_BUTTON1_MASK)) {
+		gtk_window_get_position(GTK_WINDOW(dapp->tile), &posx, &posy);
+		debug("dockapp.c: Mouse x: %d,  Mouse y: %d,  Dapp x: %d, Dapp y: %d,  Msx: %d,  Msy: %d",
+				x, y, posx, posy, motionstartx, motionstarty);
+
+		movex = posx - (motionstartx - x);
+		movey = posy - (motionstarty - y);
+		if(wmdock->propPanelOffFreePositioning == TRUE && dapp == wmdock_get_primary_anchor_dockapp()) {
+			if (movex <= 0)
+				movex = 0;
+			if (movex >= gdk_screen_get_width(get_current_gdkscreen()) - DEFAULT_DOCKAPP_WIDTH)
+				movex = gdk_screen_get_width(get_current_gdkscreen()) - DEFAULT_DOCKAPP_WIDTH;
+			if (movey <= 0)
+				movey = 0;
+			if (movey >= gdk_screen_get_height(get_current_gdkscreen()) - DEFAULT_DOCKAPP_HEIGHT)
+				movey = gdk_screen_get_height(get_current_gdkscreen()) - DEFAULT_DOCKAPP_HEIGHT;
+		}
+		gtk_window_move(GTK_WINDOW(dapp->tile), movex, movey);
+	}
+
+	if(dappOnMotion == dapp) {
+		wmdock_remove_anchors_tile_dummy();
+		dappSnap = wmdock_get_snapable_dockapp(dapp, &gluepos);
+		if(dappSnap) {
+			debug("dockapp.c: Snapable dockapp `%s' for dockapp `%s', glue: %d.", dappSnap->name, dapp->name, gluepos);
+			if(!dappDummy) {
+				dappDummy = g_new0(DockappNode, 1);
+				dappDummy->name = g_strdup(DOCKAPP_DUMMY_TITLE);
+				dappDummy->tile = wmdock_create_tile_dummy();
+			}
+
+			dappSnap->glue[gluepos] = dappDummy;
+			wmdock_order_dockapps(dappDummy);
+			gtk_widget_show_all(dappDummy->tile);
+		} else if(dappDummy) {
+			gtk_widget_hide(dappDummy->tile);
+		}
+	}
+}
+
+
+/* Return the translation from glue int postion to glue name.
+ *
+ * @param gluePos Position to be translated.
+ * @return String representation of the postion.
+ */
+const gchar *wmdock_get_glue_name(const gint glusPos)
+{
+	static gchar ret[10];
+
+	switch(glusPos) {
+	case GLUE_B:
+		g_strlcpy(ret, "GLUE_B", sizeof(ret));
+		break;
+	case GLUE_L:
+		g_strlcpy(ret, "GLUE_L", sizeof(ret));
+		break;
+	case GLUE_R:
+		g_strlcpy(ret, "GLUE_R", sizeof(ret));
+		break;
+	case GLUE_T:
+		g_strlcpy(ret, "GLUE_T", sizeof(ret));
+		break;
+	default:
+		return NULL;
+	}
+
+	return (ret);
+}
+
+/* Return the translation from the glue name to the postion.
+ *
+ * @param name The name to be translated to a number.
+ * @return The position as integer. On error -1 is returned.
+ */
+gint wmdock_get_glue_position(gchar const *name)
+{
+	if(!g_ascii_strcasecmp(name, "GLUE_B"))
+		return GLUE_B;
+	else if(!g_ascii_strcasecmp(name, "GLUE_L"))
+		return GLUE_L;
+	else if(!g_ascii_strcasecmp(name, "GLUE_R"))
+		return GLUE_R;
+	else if(!g_ascii_strcasecmp(name, "GLUE_T"))
+		return GLUE_T;
+
+	return -1;
+}
+
+
+/**
+ * Determine the main anchor DockApp.
+ *
+ * @return DockappNode which is the main anchor otherwise NULL.
+ */
+DockappNode *wmdock_get_primary_anchor_dockapp()
+{
+	gint i;
+	GList *dapps1, *dapps2;
+	DockappNode *dapp1 = NULL, *dapp2 = NULL;
+
+	if( ! IS_PANELOFF(wmdock) )
+		return NULL;
+
+	dapps1 = g_list_first(wmdock->dapps);
+
+	while(dapps1) {
+		if(!(dapp1 = DOCKAPP(dapps1->data)))
+			continue;
+
+		dapps2 = g_list_first(wmdock->dapps);
+		while(dapps2) {
+			if(!(dapp2 = DOCKAPP(dapps2->data)))
+				continue;
+
+			for(i = 0; i < GLUE_MAX; i++) {
+				if(dapp2->glue[i] == dapp1)
+					break;
+			}
+			if(i < GLUE_MAX && dapp2->glue[i] == dapp1)
+				break;
+
+			dapps2 = g_list_next(dapps2);
+		}
+		/* Main anchor DockApp found. */
+		if(!dapps2) {
+			debug("dockapp.c: Found primary dockapp `%s'", dapp1->name);
+			return(dapp1);
+		}
+
+		dapps1 = g_list_next(dapps1);
+	}
+
+	return NULL;
+}
+
+
+/**
+ * Event handler for the tile in panel off mode (event_after).
+ *
+ * @param tile The window of the event.
+ * @param ev Event informations.
+ * @param dapp DockappNode of the event.
+ */
+void wmdock_dockapp_event_after_handler(GtkWidget *window, GdkEvent *ev, DockappNode *dapp)
+{
+//	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) {
+			/* `in' is true if window window got the focus. */
+			g_list_foreach(wmdock->dapps, (GFunc) wmdock_dockapp_tofront, NULL);
+		}
+		break;
+	case GDK_VISIBILITY_NOTIFY:
+		wmdock_redraw_dockapp(dapp);
+		break;
+	default:
+		break;
+	}
+}
+
+
+/**
+ * Creates a dummy tile without any dockapp in it.
+ *
+ * @return A GTK window widget.
+ */
+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,
+			DEFAULT_DOCKAPP_HEIGHT);
+	gtk_container_set_border_width(GTK_CONTAINER(dummy), 0);
+
+	/* Disable window shrinking resizing and growing. */
+	gtk_window_set_policy (GTK_WINDOW(dummy), FALSE, FALSE, FALSE);
+	gtk_window_set_decorated(GTK_WINDOW(dummy), FALSE);
+	gtk_window_set_resizable(GTK_WINDOW(dummy), FALSE);
+	/* Window visible on all workspaces. */
+	gtk_window_stick(GTK_WINDOW(dummy));
+	gtk_window_set_focus_on_map(GTK_WINDOW(dummy), FALSE);
+	/* Hide window from the taskbar and the pager. */
+	gtk_window_set_skip_taskbar_hint(GTK_WINDOW(dummy), TRUE);
+	gtk_window_set_skip_pager_hint(GTK_WINDOW(dummy), TRUE);
+	gtk_window_set_opacity(GTK_WINDOW(dummy), 0.6);
+	gtk_widget_set_size_request(dummy, DEFAULT_DOCKAPP_WIDTH, DEFAULT_DOCKAPP_HEIGHT);
+
+	return (dummy);
+}
+
+
+/**
+ * Set focus to a dockapp.
+ *
+ * @param dapp DockappNode to focus.
+ */
+void wmdock_dockapp_tofront(DockappNode *dapp) {
+	if(!dapp)
+		return;
+
+	if ( IS_PANELOFF(wmdock) ) {
+		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), wmdock->propPanelOffKeepAbove == TRUE ? FALSE : TRUE);
+	}
+}
+
+
+gboolean wmdock_startup_dockapp(const gchar *cmd)
+{
+	gboolean ret;
+	GError *err = NULL;
+
+	ret = xfce_exec(cmd, FALSE, FALSE, &err);
+
+	/* Errors will be evaluate in a later version. */
+	if(err) g_clear_error (&err);
+
+	return(ret);
+}
+
+
+void wmdock_destroy_dockapp(DockappNode *dapp)
+{
+	Display *display = NULL;
+
+	if(dapp && (display = GDK_DISPLAY_XDISPLAY(get_current_gdkdisplay()))) {
+		XDestroyWindow(display, dapp->i);
+		debug("dockapp.c: Destroy dockapp %s", dapp->name);
+	}
+}
+
+
+void wmdock_setupdnd_dockapp(DockappNode *dapp)
+{
+	if( ! IS_PANELOFF(wmdock) ) {
+		/* Make the "well label" a DnD destination. */
+		gtk_drag_dest_set (GTK_WIDGET(dapp->tile), GTK_DEST_DEFAULT_MOTION, targetList,
+				nTargets, GDK_ACTION_MOVE);
+
+		gtk_drag_source_set (GTK_WIDGET(dapp->tile), GDK_BUTTON1_MASK, targetList,
+				nTargets, GDK_ACTION_MOVE);
+
+		g_signal_connect (dapp->tile, "drag-begin", G_CALLBACK (drag_begin_handl), dapp);
+		g_signal_connect (dapp->tile, "drag-data-get", G_CALLBACK (drag_data_get_handl), dapp);
+
+#if (GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 12)
+		g_signal_connect (dapp->tile, "drag-failed", G_CALLBACK (drag_failed_handl), dapp);
+#endif
+
+		g_signal_connect (dapp->tile, "drag-data-received", G_CALLBACK(drag_data_received_handl), dapp);
+		g_signal_connect (dapp->tile, "drag-drop", G_CALLBACK (drag_drop_handl), dapp);
+
+		debug("dockapp.c: Setup DnD for dockapp `%s'", dapp->name);
+	}
+}
+
+
+DockappNode *wmdock_find_startup_dockapp(const gchar *compCmd)
+{
+	GList *dapps;
+	DockappNode *dapp = NULL;
+
+	dapps = g_list_first(wmdock->dapps);
+
+	while(dapps) {
+		if((dapp = DOCKAPP(dapps->data))) {
+			if(!dapp->name && dapp->cmd) {
+				if(!g_ascii_strcasecmp(dapp->cmd, compCmd)) {
+					debug("dockapp.c: found startup dockapp with cmd %s", compCmd);
+					return(dapp);
+				}
+			}
+		}
+
+		dapps = g_list_next(dapps);
+	}
+
+	return(NULL);
+}
+
+/**
+ * Removes the anchor from dockapp.
+ *
+ * @param anchor The anchor dockapp.
+ * @param dapp Dockapp to unlink.
+ */
+void wmdock_remove_anchor_dockapp(DockappNode *anchor, DockappNode *dapp)
+{
+	gint i;
+
+	if( ! IS_PANELOFF(wmdock) || !anchor || !dapp)
+		return;
+
+	for(i = 0; i < GLUE_MAX; i++) {
+		if(anchor->glue[i] == dapp) {
+			debug("Remove dockapp `%s' from the parent: `%s'", anchor->glue[i]->name, anchor->name);
+			anchor->glue[i] = NULL;
+		}
+	}
+}
+
+
+/**
+ * Clear data of a DockappNode and reorder the other.
+ *
+ * @param dapp DockappNode to free.
+ */
+void wmdock_free_dockapp(DockappNode *dapp)
+{
+	gint i;
+	DockappNode *_dapp = NULL;
+
+	if( IS_PANELOFF(wmdock) ) {
+		if((_dapp = wmdock_get_parent_dockapp(dapp))) {
+			/* Remove the glue of dapp from the parent. */
+			wmdock_remove_anchor_dockapp(_dapp, dapp);
+
+			/* Cover all the glue from the closed dockapp to the parent. */
+			for(i = 0; i < GLUE_MAX; i++) {
+				if(dapp->glue[i]) {
+					if(!_dapp->glue[i]) {
+						_dapp->glue[i] = dapp->glue[i];
+					} else {
+						/* TODO: Verify this code, maybe broken? */
+
+						/* If another glue is on the parent destroy the others. */
+						wmdock_destroy_dockapp(dapp->glue[i]);
+						wmdock_free_dockapp(dapp->glue[i]);
+					}
+				}
+			}
+		}
+	}
+
+	wmdock->dapps = g_list_remove_all(wmdock->dapps, dapp);
+	gtk_widget_destroy(GTK_WIDGET(dapp->tile));
+	g_free(dapp->name);
+	g_free(dapp->cmd);
+	g_free(dapp);
+
+	if(g_list_length (wmdock->dapps) == 0) {
+		wmdock_panel_draw_wmdock_icon(FALSE);
+	}
+
+	wmdock_refresh_properties_dialog();
+	if ( IS_PANELOFF(wmdock) )
+		wmdock_order_dockapps(wmdock_get_primary_anchor_dockapp());
+}
+
+
+void wmdock_dapp_closed(GtkSocket *socket, DockappNode *dapp)
+{
+	debug("dockapp.c: closed window signal ! (dockapp: %s)", dapp->name);
+	wmdock_free_dockapp(dapp);
+}
+
+
+void wmdock_redraw_dockapp(DockappNode *dapp)
+{
+	gtk_widget_unmap (GTK_WIDGET(dapp->s));
+	wmdock_set_tile_background(dapp, gdkPbTileDefault);
+
+	debug("dockapp.c: Dockapp %s redrawed with tile %s.", dapp->name, wmdock->propDispTile ? "enabled" : "disabled");
+
+	if(dapp->bg)
+		gdk_window_process_updates(dapp->bg->window, FALSE);
+	gtk_widget_map (GTK_WIDGET(dapp->s));
+	gtk_widget_show_all(GTK_WIDGET(dapp->s));
+}
+
+
+/**
+ * Update the background image of the DockApp.
+ *
+ * @param dapp DockappNode to update.
+ */
+void wmdock_update_tile_background(DockappNode *dapp)
+{
+	gtk_widget_realize(GTK_WIDGET(dapp->evbox));
+
+	if (!dapp->bgimg)
+		return;
+
+	gtk_widget_set_app_paintable(GTK_WIDGET(dapp->evbox), TRUE);
+	gtk_widget_set_app_paintable(GTK_WIDGET(dapp->bg), TRUE);
+	gdk_window_set_back_pixmap(GTK_WIDGET(dapp->evbox)->window, dapp->bgimg, FALSE);
+	gdk_window_set_back_pixmap(GTK_WIDGET(dapp->bg)->window, dapp->bgimg, FALSE);
+
+	if (GTK_WIDGET_FLAGS(GTK_WIDGET(dapp->evbox)) & GTK_MAPPED)
+		gtk_widget_queue_draw(GTK_WIDGET(dapp->evbox));
+	if (GTK_WIDGET_FLAGS(GTK_WIDGET(dapp->bg)) & GTK_MAPPED)
+		gtk_widget_queue_draw(GTK_WIDGET(dapp->bg));
+}
+
+
+/**
+ * Get parent dockapp.
+ *
+ * @param dapp Child dockapp.
+ * @return DockAppNode Parent dockapp or null.
+ */
+DockappNode *wmdock_get_parent_dockapp(DockappNode *dapp)
+{
+	gint i;
+	GList *dapps;
+	DockappNode *_dapp;
+
+	if (! IS_PANELOFF(wmdock) )
+		return NULL;
+
+	dapps = g_list_first(wmdock->dapps);
+
+	while(dapps) {
+		_dapp = DOCKAPP(dapps->data);
+
+		for(i = 0; i < GLUE_MAX; i++) {
+			if(_dapp->glue[i] == dapp)
+				return _dapp;
+		}
+
+		dapps = g_list_next(dapps);
+	}
+
+	return NULL;
+}
+
+
+/**
+ * Get the default glue position of the dockapps.
+ *
+ * @return Default glue postion.
+ */
+gint wmdock_get_default_gluepos()
+{
+	if(wmdock->anchorPos == ANCHOR_TL || wmdock->anchorPos == ANCHOR_TR)
+		return (GLUE_B);
+	else
+		return (GLUE_T);
+}
+
+
+/**
+ * This set the tile background image to the DockApp.
+ *
+ * @param dapp The DockApp to set.
+ * @param pm The background image to set.
+ */
+void wmdock_set_tile_background(DockappNode *dapp, GdkPixbuf *pb)
+{
+	GdkGC * gc = NULL;
+
+	if(wmdock->propDispTile == FALSE) {
+		if(!dapp->bg)
+			return;
+
+		gtk_image_clear(GTK_IMAGE(dapp->bg));
+		gtk_image_set_from_pixmap(GTK_IMAGE(dapp->bg), NULL, NULL);
+
+		gdk_pixmap_unref(dapp->bgimg);
+		dapp->bgimg = NULL;
+		gdk_window_clear(GTK_WIDGET(dapp->tile)->window);
+
+		return;
+	}
+
+	debug("dockapp.c: Setup background image for dapp `%s' (wmdock_set_tile_background).", dapp->name);
+	gtk_widget_realize(GTK_WIDGET(dapp->bg));
+
+	if(!dapp->bgimg)
+		dapp->bgimg = gdk_pixmap_new(GTK_WIDGET(dapp->tile)->window, DEFAULT_DOCKAPP_WIDTH,DEFAULT_DOCKAPP_HEIGHT, -1);
+
+	gdk_window_clear(GTK_WIDGET(dapp->bg)->window);
+	gc = gdk_gc_new(GTK_WIDGET(dapp->bg)->window);
+	gdk_draw_pixbuf(dapp->bgimg, gc,
+			pb, 0, 0, 0, 0, DEFAULT_DOCKAPP_WIDTH, DEFAULT_DOCKAPP_HEIGHT,
+			GDK_RGB_DITHER_NONE, 0, 0);
+	if( ! IS_PANELOFF(wmdock) ) {
+		gdk_window_clear(GTK_WIDGET(dapp->evbox)->window);
+		gdk_draw_pixbuf(GTK_WIDGET(dapp->evbox)->window, gc,
+				pb, 0, 0, 0, 0, DEFAULT_DOCKAPP_WIDTH, DEFAULT_DOCKAPP_HEIGHT,
+				GDK_RGB_DITHER_NONE, 0, 0);
+	}
+	gdk_gc_unref(gc);
+
+	if(dapp->bg)
+		wmdock_update_tile_background(dapp);
+
+}
+
+
+void wmdock_set_socket_postion(DockappNode *dapp, int x, int y)
+{
+	GtkFixed *fixed = NULL;
+
+	if(!(fixed = (GtkFixed *) gtk_widget_get_ancestor(GTK_WIDGET(dapp->evbox), GTK_TYPE_FIXED)))
+		return;
+
+	gtk_widget_set_size_request(GTK_WIDGET(dapp->evbox), dapp->width, dapp->height);
+	gtk_fixed_move(fixed, GTK_WIDGET(dapp->evbox), x, y);
+}
+
+
+GtkWidget *wmdock_create_tile_from_socket(DockappNode *dapp)
+{
+	GtkWidget *tile = NULL;
+	GtkWidget *_fixed = NULL;
+	GtkWidget *_evbox = NULL;
+
+	tile = _fixed = gtk_fixed_new();
+	gtk_container_set_border_width(GTK_CONTAINER(_fixed), 0);
+
+	/* Create an internal eventbox to catch click events outside the socket. */
+	_evbox = gtk_event_box_new();
+	gtk_widget_set_size_request(GTK_WIDGET(_evbox), DEFAULT_DOCKAPP_WIDTH, DEFAULT_DOCKAPP_HEIGHT);
+	gtk_fixed_put(GTK_FIXED(_fixed), _evbox, 0, 0);
+
+	/* Create an eventbox to catch to click and motion events inside the socket. */
+	dapp->evbox = gtk_event_box_new();
+	gtk_event_box_set_above_child(GTK_EVENT_BOX(dapp->evbox), FALSE);
+
+	/* Add the GtkSocket with the dockapp fixed and centered. */
+	gtk_container_add(GTK_CONTAINER(dapp->evbox), GTK_WIDGET(dapp->s));
+	gtk_fixed_put(GTK_FIXED(_fixed), GTK_WIDGET(dapp->evbox),
+			(DEFAULT_DOCKAPP_WIDTH - dapp->width) / 2, (DEFAULT_DOCKAPP_HEIGHT - dapp->height) / 2);
+
+	/* Add the background tile. */
+	dapp->bg = wmdock->propDispTile == TRUE ? gtk_image_new_from_pixbuf(gdkPbTileDefault) : gtk_image_new();
+	gtk_widget_set_size_request(GTK_WIDGET(dapp->bg), DEFAULT_DOCKAPP_WIDTH, DEFAULT_DOCKAPP_HEIGHT);
+	gtk_container_add(GTK_CONTAINER(_evbox), GTK_WIDGET(dapp->bg));
+
+	/* Set the background style of the tile window like the XFCE panel. */
+	gtk_widget_set_style(GTK_WIDGET(dapp->evbox), gtk_widget_get_style(GTK_WIDGET(wmdock->plugin)));
+	gtk_widget_set_style(GTK_WIDGET(_evbox), gtk_widget_get_style(GTK_WIDGET(wmdock->plugin)));
+
+	if( IS_PANELOFF(wmdock) ) {
+		/* If propDispPanelOff is true create a separate window with the
+		 * Dockapp in it. It's emulates WindowMaker much more.
+		 */
+		tile = gtk_window_new(GTK_WINDOW_TOPLEVEL);
+		debug("dockapp.c: Setup a separate window for the DockApp.");
+
+		gtk_window_set_title(GTK_WINDOW(tile), dapp->name);
+		gtk_window_set_default_size(GTK_WINDOW(tile), DEFAULT_DOCKAPP_WIDTH, DEFAULT_DOCKAPP_HEIGHT);
+		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), wmdock->propPanelOffKeepAbove == TRUE ? FALSE : TRUE);
+		gtk_window_set_keep_above(GTK_WINDOW(tile), FALSE);
+
+		/* Disable window shrinking resizing and growing. */
+		gtk_window_set_policy (GTK_WINDOW(tile), FALSE, FALSE, FALSE);
+		gtk_window_set_decorated(GTK_WINDOW(tile), FALSE);
+		gtk_window_set_resizable(GTK_WINDOW(tile), FALSE);
+		/* Window visible on all workspaces. */
+		gtk_window_stick(GTK_WINDOW(tile));
+		gtk_window_set_focus_on_map(GTK_WINDOW(tile), FALSE);
+		/* Hide window from the taskbar and the pager. */
+		gtk_window_set_skip_taskbar_hint(GTK_WINDOW(tile), TRUE);
+		gtk_window_set_skip_pager_hint(GTK_WINDOW(tile), TRUE);
+
+		gtk_container_add(GTK_CONTAINER(tile), _fixed);
+
+		g_signal_connect(G_OBJECT(tile), "motion_notify_event", G_CALLBACK(wmdock_dockapp_motion_notify_handler), dapp);
+		g_signal_connect(G_OBJECT(tile), "button_press_event", G_CALLBACK(wmdock_dockapp_button_press_handler), dapp);
+		g_signal_connect(G_OBJECT(tile), "button_release_event", G_CALLBACK(wmdock_dockapp_button_release_handler), dapp);
+	}
+
+	gtk_widget_show(_fixed);
+
+	return (tile);
+}
+
+/**
+ * Calculate the position of the DockApp if the PanelOff mode is active.
+ *
+ * @param dapp The dockapp for the move operation.
+ * @param prevDapp The previous dockapp.
+ */
+void wmdock_set_autoposition_dockapp(DockappNode *dapp, DockappNode *prevDapp)
+{
+	gint panelx, panely, plugx, plugy;
+	gint x, y, i, offsetx, offsety, gluepos = GLUE_MAX;
+	XfceScreenPosition xfceScrPos;
+
+	if(! IS_PANELOFF(wmdock) || !dapp || blockDappReorder == TRUE)
+		return;
+
+	/* Setup the position of the first dockapp. */
+	panelx = panely = plugx = plugy = x = y = 0;
+
+	gtk_window_get_position (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (wmdock->plugin))), &panelx, &panely);
+	gdk_window_get_position (GDK_WINDOW (GTK_WIDGET (wmdock->plugin)->window), &plugx, &plugy);
+
+	for(i = 0; prevDapp && i < GLUE_MAX; i++) {
+		if(prevDapp->glue[i] == dapp) {
+			gluepos = i;
+			break;
+		}
+	}
+
+	if(gluepos != GLUE_MAX) {
+		/* Realign the existing dockapp. */
+		wmdock_dockapp_child_pos(prevDapp, gluepos, &x, &y);
+	} else {
+		/* Align a new dockapp. */
+		if(prevDapp) {
+			/* If a parent dockapp already exists. */
+			gluepos = wmdock_get_default_gluepos();
+
+			wmdock_dockapp_child_pos(prevDapp, gluepos, &x, &y);
+			prevDapp->glue[gluepos] = dapp;
+		} else {
+			/* Determine the initial dockapp position. */
+			xfceScrPos = xfce_panel_plugin_get_screen_position(wmdock->plugin);
+
+			offsetx = offsety = 0;
+			switch(wmdock->anchorPos) {
+			case ANCHOR_TL:
+				if((xfceScrPos == XFCE_SCREEN_POSITION_NW_V ||
+						xfceScrPos == XFCE_SCREEN_POSITION_W ||
+						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 ||
+						xfceScrPos == XFCE_SCREEN_POSITION_N ||
+						xfceScrPos == XFCE_SCREEN_POSITION_NE_H) &&
+						wmdock->propPanelOffIgnoreOffset == FALSE) {
+					offsetx = 0;
+					offsety = panely == 0 ? xfce_panel_plugin_get_size(wmdock->plugin) + 1 : 0;
+				}
+
+				x = 0 + offsetx;
+				y = 0 + offsety;
+				break;
+			case ANCHOR_TR:
+				if((xfceScrPos == XFCE_SCREEN_POSITION_NE_V ||
+						xfceScrPos == XFCE_SCREEN_POSITION_E ||
+						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 ||
+						xfceScrPos == XFCE_SCREEN_POSITION_N ||
+						xfceScrPos == XFCE_SCREEN_POSITION_NE_H) &&
+						wmdock->propPanelOffIgnoreOffset == FALSE) {
+					offsetx = 0;
+					offsety = panely == 0 ? xfce_panel_plugin_get_size(wmdock->plugin) + 1 : 0;
+				}
+
+				x = gdk_screen_get_width(get_current_gdkscreen()) - DEFAULT_DOCKAPP_WIDTH - offsetx;
+				y = 0 + offsety;
+				break;
+			case ANCHOR_BL:
+				if((xfceScrPos == XFCE_SCREEN_POSITION_NW_V ||
+						xfceScrPos == XFCE_SCREEN_POSITION_W ||
+						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 ||
+						xfceScrPos == XFCE_SCREEN_POSITION_S ||
+						xfceScrPos == XFCE_SCREEN_POSITION_SE_H) &&
+						wmdock->propPanelOffIgnoreOffset == FALSE) {
+					offsetx = 0;
+					offsety = xfce_panel_plugin_get_size(wmdock->plugin) + 1;
+				}
+
+				x = 0 + offsetx;
+				y = gdk_screen_get_height(get_current_gdkscreen()) - DEFAULT_DOCKAPP_HEIGHT - offsety;
+				break;
+			case ANCHOR_BR:
+				if((xfceScrPos == XFCE_SCREEN_POSITION_NE_V ||
+						xfceScrPos == XFCE_SCREEN_POSITION_E ||
+						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 ||
+						xfceScrPos == XFCE_SCREEN_POSITION_S ||
+						xfceScrPos == XFCE_SCREEN_POSITION_SE_H) &&
+						wmdock->propPanelOffIgnoreOffset == FALSE) {
+					offsetx = 0;
+					offsety = xfce_panel_plugin_get_size(wmdock->plugin) + 1;
+				}
+
+				x = gdk_screen_get_width(get_current_gdkscreen()) - DEFAULT_DOCKAPP_WIDTH - offsetx;
+				y = gdk_screen_get_height(get_current_gdkscreen()) - DEFAULT_DOCKAPP_HEIGHT - offsety;
+				break;
+			default:
+				debug("dockapp.c: Can not determine panel position x = y = 0.");
+				x = y = 0;
+				break;
+			}
+
+			if(wmdock->propPanelOffFreePositioning == TRUE) {
+				/* If panelOffFpX, panelOffFpy uninitialized (G_MININT) set the determined value,
+				 * otherwise set the stored value to x and y.
+				 */
+				x = wmdock->panelOffFpX == RCDEFAULT_PANELOFFFPX ? x : wmdock->panelOffFpX;
+				y = wmdock->panelOffFpY == RCDEFAULT_PANELOFFFPY ? y : wmdock->panelOffFpY;
+			}
+		} /* 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",
+			g_list_length(wmdock->dapps), panelx, panely, plugx, plugy, prevDapp ? prevDapp->name : "NO", x, y);
+
+}
+
+
+/**
+ * Function order all dockapps (panel off) starting from dapp.
+ *
+ * @param dappStart Dockapp to start with.
+ */
+void wmdock_order_dockapps(DockappNode *dapp)
+{
+	gint i;
+
+	if(! IS_PANELOFF(wmdock) || !dapp || blockDappReorder == TRUE)
+		return;
+
+	for(i = 0; i < GLUE_MAX; i++) {
+		wmdock_set_autoposition_dockapp(dapp, wmdock_get_parent_dockapp(dapp));
+
+		debug("dockapp.c: Order dockapp %s", dapp->name);
+		/* Recurse calling wmdock_order_dockapps, to walk the hole tree. */
+		if(dapp->glue[i])
+			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
new file mode 100644
index 0000000..95de9d3
--- /dev/null
+++ b/panel-plugin/dockapp.h
@@ -0,0 +1,79 @@
+/* wmdock xfce4 plugin by Andre Ellguth
+ * dockapp.h
+ *
+ * Authors:
+ *   Andre Ellguth <andre at ellguth.com>
+ *
+ * License:
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this package; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+#ifndef __DOCKAPP_H__
+#define __DOCKAPP_H__
+
+#include "wmdock.h"
+
+enum GluePosition {
+	GLUE_T    = 1,
+	GLUE_B    = 2,
+	GLUE_L    = 4,
+	GLUE_R    = 8,
+	GLUE_MAX
+};
+
+typedef struct _dockapp DockappNode;
+struct _dockapp {
+	GtkSocket       *s;
+	GdkNativeWindow i;
+	gint            width;
+	gint            height;
+	GtkWidget       *bg;
+	GdkPixmap       *bgimg;
+	GtkWidget       *evbox;
+	GtkWidget       *tile;
+	gchar           *name;
+	gchar           *cmd;
+	DockappNode     *glue[GLUE_MAX];
+};
+
+#define DOCKAPP_DUMMY_TITLE "__WMDOCK_dummy__"
+#define DOCKAPP(__dapp) ((DockappNode *) __dapp)
+
+gboolean wmdock_startup_dockapp(const gchar *);
+void wmdock_setupdnd_dockapp(DockappNode *);
+void wmdock_destroy_dockapp(DockappNode *);
+void wmdock_redraw_dockapp(DockappNode *);
+void wmdock_free_dockapp(DockappNode *);
+void wmdock_dapp_closed(GtkSocket *, DockappNode *);
+DockappNode *wmdock_find_startup_dockapp(const gchar *);
+GtkWidget *wmdock_create_tile_from_socket(DockappNode *);
+void wmdock_set_socket_postion(DockappNode *, int, int);
+void wmdock_set_autoposition_dockapp(DockappNode *, DockappNode *);
+void wmdock_refresh_bg(GtkWidget *widget);
+void wmdock_set_tile_background(DockappNode *, GdkPixbuf *);
+void wmdock_update_tile_background(DockappNode *);
+DockappNode *wmdock_get_parent_dockapp(DockappNode *);
+DockappNode *wmdock_get_primary_anchor_dockapp();
+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 *);
+const gchar *wmdock_get_glue_name(const gint);
+
+#endif /* __DOCKAPP_H__ */
diff --git a/panel-plugin/wmdock.h b/panel-plugin/extern.h
similarity index 50%
copy from panel-plugin/wmdock.h
copy to panel-plugin/extern.h
index f8c42c9..c82cd98 100644
--- a/panel-plugin/wmdock.h
+++ b/panel-plugin/extern.h
@@ -1,9 +1,8 @@
 /* wmdock xfce4 plugin by Andre Ellguth
- *
- * $Id$
+ * extern.h
  *
  * Authors:
- *   Andre Ellguth <ellguth at ibh.de>
+ *   Andre Ellguth <andre at ellguth.com>
  *
  * License:
  *   This program is free software; you can redistribute it and/or modify
@@ -21,40 +20,17 @@
  *   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-#ifndef __WMDOCK_H__
-#define __WMDOCK_H__
-
-#include <gtk/gtk.h>
-#include <libxfce4panel/libxfce4panel.h>
-
-#define WNCK_I_KNOW_THIS_IS_UNSTABLE
-#include <libwnck/libwnck.h>
-
-typedef struct _dockapp {
- GtkSocket       *s;
- GdkNativeWindow i;
- GtkWidget       *bg;
- GtkWidget       *tile;
- gchar           *name;
- gchar           *cmd;
-} DockappNode;
-
-typedef struct {
- XfcePanelPlugin *plugin;
+#ifndef __EXTERN_H__
+#define __EXTERN_H__
 
- GtkWidget       *eventBox;
-	
- /* Plugin specific definitions */
- GtkWidget       *align;
- GtkWidget       *box;
- GtkWidget       *panelBox;
-	
- gboolean        propDispTile;
- gboolean        propDispPropButton;
- gboolean        propDispAddOnlyWM;
- gchar           *filterList;
+#include "wmdock.h"
 
- GList           *dapps;
-} WmdockPlugin;
+extern WmdockPlugin *wmdock;
+extern GdkPixbuf    *gdkPbIcon;
+extern GdkPixbuf    *gdkPbTileDefault;
+extern GtkWidget    *wmdockIcon;
+extern Atom         XfceDockAppAtom;
+extern gchar        **rcCmds;
+extern gboolean     rcPanelOff;
 
-#endif /* __WMDOCK_H__ */
+#endif /* __EXTERN_H__ */
diff --git a/panel-plugin/misc.c b/panel-plugin/misc.c
new file mode 100644
index 0000000..f260f75
--- /dev/null
+++ b/panel-plugin/misc.c
@@ -0,0 +1,331 @@
+/* wmdock xfce4 plugin by Andre Ellguth
+ * Misc functions.
+ *
+ * Authors:
+ *   Andre Ellguth <andre at ellguth.com>
+ *
+ * License:
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this package; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <X11/Xatom.h>
+#include <X11/Xutil.h>
+
+#define WNCK_I_KNOW_THIS_IS_UNSTABLE
+#include <libwnck/libwnck.h>
+
+#include <gtk/gtk.h>
+
+#include "extern.h"
+#include "wmdock.h"
+#include "debug.h"
+#include "dockapp.h"
+#include "misc.h"
+
+#include "xfce4-wmdock-plugin.xpm"
+
+GdkPixbuf *get_icon_from_xpm_scaled(const char **xpmData, gint width, gint height)
+{
+	GdkPixbuf *gdkPb = NULL;
+	GdkPixbuf *gdkPbScaled = NULL;
+
+	gdkPb = gdk_pixbuf_new_from_xpm_data (xpmData);
+
+	gdkPbScaled = gdk_pixbuf_scale_simple(gdkPb, width, height,
+			GDK_INTERP_BILINEAR);
+
+	g_object_unref (G_OBJECT (gdkPb));
+
+	return(gdkPbScaled);
+}
+
+
+void set_xsmp_support(WnckWindow *w)
+{
+	/* Workaround to skip the XFCE4 session manager. If the window
+	 * has this X text property set, the XFCE4 session manager will not
+	 * automaticly start the dockapp after startup twice. */
+
+	XTextProperty tp;
+	static Atom _XA_SM_CLIENT_ID = None;
+
+	_XA_SM_CLIENT_ID = XInternAtom (GDK_DISPLAY_XDISPLAY(get_current_gdkdisplay()), "SM_CLIENT_ID", False);
+
+
+	tp.value = (unsigned char *) strdup("SM_CLIENT_ID");
+	tp.encoding = XA_STRING;
+	tp.format = 8;
+	tp.nitems = 1;
+
+	XSetTextProperty(GDK_DISPLAY_XDISPLAY(get_current_gdkdisplay()),
+			wnck_window_get_xid(w),
+			&tp, _XA_SM_CLIENT_ID);
+
+	XFree((unsigned char *)tp.value);
+}
+
+
+gboolean comp_str_with_pattern(const gchar *str, gchar *pattern, gsize s)
+{
+	gboolean    r = FALSE;
+
+	if(!str || !pattern) return FALSE;
+
+#if (GLIB_MAJOR_VERSION >= 2 && GLIB_MINOR_VERSION >= 14)
+	GRegex *regex = g_regex_new (pattern, G_REGEX_CASELESS, 0, NULL);
+	if(regex) {
+		r = g_regex_match (regex, str, 0, NULL);
+		g_regex_unref (regex);
+	}
+#else
+	gsize    maxsize;
+	gint     i;
+
+	maxsize = s > strlen(pattern) ? strlen(pattern) : s;
+
+	for(i=0; i<strlen(str)&&strlen(&str[i]) >= maxsize;i++)
+		if(!g_ascii_strncasecmp (&str[i], pattern, maxsize)) {
+			r = TRUE;
+			break;
+		}
+#endif
+
+	return r;
+}
+
+
+gboolean comp_dockapp_with_filterlist(const gchar *name)
+{
+	gchar **patterns = NULL;
+	gint i=0;
+	gsize s=0;
+	gboolean r = FALSE;
+
+	if(!wmdock->filterList) return FALSE;
+
+	patterns = g_strsplit (wmdock->filterList, ";", 0);
+	if(!patterns) return FALSE;
+	while(patterns[i]) {
+		s = strlen(patterns[i]) > 256 ? 256 : strlen(patterns[i]);
+		if(s > 0 &&
+				(r=comp_str_with_pattern(name, patterns[i], s)) == TRUE)
+			break;
+		i++;
+	}
+
+	g_strfreev(patterns);
+	return r;
+}
+
+
+gboolean has_dockapp_hint(WnckWindow *w)
+{
+	Atom atype;
+	int afmt;
+	unsigned long int nitems;
+	unsigned long int naft;
+	gboolean r = FALSE;
+	unsigned char *dat = NULL;
+
+	gdk_error_trap_push();
+	if (XGetWindowProperty(
+			GDK_DISPLAY_XDISPLAY(get_current_gdkdisplay()),
+			wnck_window_get_xid(w), XfceDockAppAtom, 0, 1, False,
+			XA_CARDINAL, &atype, &afmt, &nitems, &naft, &dat) == Success) {
+		if (nitems==1 && ((long int *) dat)[0]==1) {
+			r = TRUE;
+		}
+		XFree(dat);
+	}
+	XSync(GDK_DISPLAY_XDISPLAY(get_current_gdkdisplay()),False);
+
+	gdk_error_trap_pop();
+
+	return (r);
+}
+
+
+/**
+ * Returns the current GdkDisplay.
+ *
+ * @return current GdkDisplay
+ */
+GdkDisplay *get_current_gdkdisplay()
+{
+	if(!wmdock || !wmdock->plugin)
+		return gdk_display_get_default();
+
+	return gdk_window_get_display(gtk_widget_get_toplevel(GTK_WIDGET(wmdock->plugin))->window);
+}
+
+
+/**
+ * Return the current GdkScreen.
+ *
+ * @return current GdkScreen
+ */
+GdkScreen *get_current_gdkscreen()
+{
+	if(!wmdock || !wmdock->plugin)
+		return gdk_screen_get_default();
+
+	return gdk_window_get_screen(gtk_widget_get_toplevel(GTK_WIDGET(wmdock->plugin))->window);
+}
+
+
+/**
+ * Returns the default anchor postion for the XFCE panel.
+ *
+ * @return default anchor postion
+ */
+AnchorPostion get_default_anchor_postion()
+{
+	AnchorPostion anchorPos = ANCHOR_BR;
+
+	if(!wmdock || !wmdock->plugin)
+		return anchorPos;
+
+	switch(xfce_panel_plugin_get_screen_position(wmdock->plugin)) {
+	case XFCE_SCREEN_POSITION_NW_H:
+	case XFCE_SCREEN_POSITION_N:
+	case XFCE_SCREEN_POSITION_NE_H:
+		anchorPos = ANCHOR_TR;
+		break;
+
+	case XFCE_SCREEN_POSITION_SW_H:
+	case XFCE_SCREEN_POSITION_S:
+	case XFCE_SCREEN_POSITION_SE_H:
+		anchorPos = ANCHOR_BR;
+		break;
+
+	case XFCE_SCREEN_POSITION_NW_V:
+	case XFCE_SCREEN_POSITION_W:
+	case XFCE_SCREEN_POSITION_SW_V:
+		anchorPos = ANCHOR_TL;
+		break;
+
+	case XFCE_SCREEN_POSITION_NE_V:
+	case XFCE_SCREEN_POSITION_E:
+	case XFCE_SCREEN_POSITION_SE_V:
+		anchorPos = ANCHOR_TR;
+		break;
+
+	default:
+		break;
+	}
+
+	return anchorPos;
+}
+
+
+/**
+ * Function get the number of xfce4-wmdock-instances are running.
+ *
+ * @return int Process count of wmdock-plugin.
+ */
+int wmdock_get_instance_count()
+{
+	int count = 0;
+
+#ifdef __linux__
+	int i;
+	FILE *fp = NULL;
+	char buf[BUF_MAX], username[BUF_MAX];
+
+#ifdef HAVE_CONFIG_H
+	snprintf(buf, BUF_MAX, "ps -C %s -ouser=", GETTEXT_PACKAGE);
+#else
+	snprintf(cmd, BUF_MAX, "ps -C xfce4-wmdock-plugin -ouser=");
+#endif /* HAVE_CONFIG_H */
+
+	fp = popen(buf, "r");
+	if(!fp)
+		return(-1);
+
+	memset(buf, '\0', BUF_MAX * sizeof(char));
+	strncpy(username, (const char *) g_get_user_name(), BUF_MAX);
+	while(!feof(fp)) {
+		buf[0] = 0;
+		fgets(buf, BUF_MAX, fp);
+		/* Remove all newline and carriage returns. */
+		for(i = 0; i < BUF_MAX; i++)
+			buf[i] = (buf[i] == 0xA || buf[i] == 0xD) ? 0 : buf[i];
+
+		if(!strncmp(buf, username, BUF_MAX))
+			count++;
+	}
+	pclose(fp);
+#endif /* __linux__ */
+
+	debug("misc.c: Instance count: %d", count);
+
+	return count;
+}
+
+
+void wmdock_panel_draw_wmdock_icon (gboolean redraw)
+{
+	gdkPbIcon = get_icon_from_xpm_scaled((const char **) xfce4_wmdock_plugin_xpm,
+			xfce_panel_plugin_get_size (wmdock->plugin) - 2,
+			xfce_panel_plugin_get_size (wmdock->plugin) - 2);
+	if(redraw == TRUE && wmdockIcon) {
+		gtk_image_set_from_pixbuf (GTK_IMAGE(wmdockIcon), gdkPbIcon);
+	} else {
+		if(wmdockIcon)
+			gtk_widget_destroy(wmdockIcon);
+
+		wmdockIcon = gtk_image_new_from_pixbuf (gdkPbIcon);
+		gtk_box_pack_start(GTK_BOX(wmdock->box), GTK_WIDGET(wmdockIcon), FALSE, FALSE, 0);
+	}
+	g_object_unref (G_OBJECT (gdkPbIcon));
+
+	gtk_widget_show_all(GTK_WIDGET(wmdockIcon));
+}
+
+
+/**
+ * Function destroys the info dialog.
+ *
+ */
+static void wmdock_msg_dialog_response (GtkWidget  *gtkDlg, gint response)
+{
+	gtk_widget_destroy (gtkDlg);
+}
+
+
+/**
+ * Function shows an info message (msg) in a dialog box.
+ *
+ * @param msg The info message as null terminated string.
+ */
+void wmdock_msg_dialog(GtkMessageType type, const gchar *fmt, ...)
+{
+	va_list args;
+	gchar msg[BUF_MAX];
+	GtkWidget *gtkDlg = NULL;
+
+	va_start(args, fmt);
+	vsnprintf((char *) msg, BUF_MAX, (const char *) fmt, args);
+	va_end(args);
+
+	gtkDlg = gtk_message_dialog_new(GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (wmdock->plugin))),
+			GTK_DIALOG_DESTROY_WITH_PARENT, type, GTK_BUTTONS_OK, msg);
+	g_signal_connect (gtkDlg, "response", G_CALLBACK (wmdock_msg_dialog_response), NULL);
+	gtk_dialog_run (GTK_DIALOG(gtkDlg));
+}
diff --git a/panel-plugin/wmdock.h b/panel-plugin/misc.h
similarity index 50%
copy from panel-plugin/wmdock.h
copy to panel-plugin/misc.h
index f8c42c9..91c68ec 100644
--- a/panel-plugin/wmdock.h
+++ b/panel-plugin/misc.h
@@ -1,9 +1,8 @@
 /* wmdock xfce4 plugin by Andre Ellguth
- *
- * $Id$
+ * misc.h
  *
  * Authors:
- *   Andre Ellguth <ellguth at ibh.de>
+ *   Andre Ellguth <andre at ellguth.com>
  *
  * License:
  *   This program is free software; you can redistribute it and/or modify
@@ -20,41 +19,20 @@
  *   along with this package; if not, write to the Free Software
  *   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
-
-#ifndef __WMDOCK_H__
-#define __WMDOCK_H__
-
-#include <gtk/gtk.h>
-#include <libxfce4panel/libxfce4panel.h>
-
-#define WNCK_I_KNOW_THIS_IS_UNSTABLE
-#include <libwnck/libwnck.h>
-
-typedef struct _dockapp {
- GtkSocket       *s;
- GdkNativeWindow i;
- GtkWidget       *bg;
- GtkWidget       *tile;
- gchar           *name;
- gchar           *cmd;
-} DockappNode;
-
-typedef struct {
- XfcePanelPlugin *plugin;
-
- GtkWidget       *eventBox;
-	
- /* Plugin specific definitions */
- GtkWidget       *align;
- GtkWidget       *box;
- GtkWidget       *panelBox;
-	
- gboolean        propDispTile;
- gboolean        propDispPropButton;
- gboolean        propDispAddOnlyWM;
- gchar           *filterList;
-
- GList           *dapps;
-} WmdockPlugin;
-
-#endif /* __WMDOCK_H__ */
+#ifndef __MISC_H__
+#define __MISC_H__
+
+/* Prototypes */
+GdkPixbuf *get_icon_from_xpm_scaled(const char **, gint, gint);
+GdkDisplay *get_current_gdkdisplay();
+GdkScreen *get_current_gdkscreen();
+void set_xsmp_support(WnckWindow *);
+gboolean has_dockapp_hint(WnckWindow *);
+gboolean comp_dockapp_with_filterlist(const gchar *);
+gboolean comp_str_with_pattern(const gchar *, gchar *, gsize);
+void wmdock_panel_draw_wmdock_icon (gboolean redraw);
+int wmdock_get_instance_count();
+AnchorPostion get_default_anchor_postion();
+void wmdock_msg_dialog(GtkMessageType, const gchar *, ...);
+
+#endif /* __MISC_H__ */
diff --git a/panel-plugin/props.c b/panel-plugin/props.c
new file mode 100644
index 0000000..a770a40
--- /dev/null
+++ b/panel-plugin/props.c
@@ -0,0 +1,604 @@
+/* wmdock xfce4 plugin by Andre Ellguth
+ * Properties dialog.
+ *
+ * Authors:
+ *   Andre Ellguth <andre at ellguth.com>
+ *
+ * License:
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this package; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <gtk/gtk.h>
+#include <libxfce4util/libxfce4util.h>
+#include <libxfcegui4/libxfcegui4.h>
+#include <libxfce4panel/libxfce4panel.h>
+
+#include "extern.h"
+#include "props.h"
+#include "wmdock.h"
+#include "debug.h"
+#include "dockapp.h"
+#include "misc.h"
+
+#include "xfce4-wmdock-plugin.xpm"
+
+/* Properties dialog */
+static struct {
+	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, *lblPanelOffHint; /* Labels */
+	GtkWidget *chkDispTile, *chkPropButton, *chkAddOnlyWM, *chkPanelOff, *chkPanelOffIgnoreOffset, *chkPanelOffKeepAbove, *chkPanelOffFreePositioning; /* 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;
+
+
+static void wmdock_set_prop_paneloff(gboolean enabled)
+{
+	gtk_widget_set_sensitive(GTK_WIDGET(prop.radioPanelOffBL), enabled);
+	gtk_widget_set_sensitive(GTK_WIDGET(prop.radioPanelOffBR), enabled);
+	gtk_widget_set_sensitive(GTK_WIDGET(prop.radioPanelOffTL), enabled);
+	gtk_widget_set_sensitive(GTK_WIDGET(prop.radioPanelOffTR), enabled);
+	gtk_widget_set_sensitive(GTK_WIDGET(prop.chkPanelOffKeepAbove), enabled);
+	gtk_widget_set_sensitive(GTK_WIDGET(prop.chkPanelOffFreePositioning), enabled);
+	gtk_widget_set_sensitive(GTK_WIDGET(prop.chkPanelOffIgnoreOffset), enabled);
+	gtk_widget_set_sensitive(GTK_WIDGET(prop.lblPanelOffPlacement), enabled);
+	gtk_widget_set_sensitive(GTK_WIDGET(prop.lblPanelOffHint), enabled);
+}
+
+
+static void wmdock_properties_fillcmbx(DockappNode *dapp, GtkWidget *gtkComboBox)
+{
+
+	if(gtkComboBox) {
+		debug("props.c: %s append to list", dapp->name);
+		gtk_combo_box_append_text (GTK_COMBO_BOX(gtkComboBox), dapp->name);
+	}
+}
+
+
+static void wmdock_properties_chkdisptile(GtkToggleButton *gtkChkDispTile, gpointer user_data)
+{
+	wmdock->propDispTile = gtk_toggle_button_get_active(gtkChkDispTile);
+
+	g_list_foreach(wmdock->dapps, (GFunc)wmdock_redraw_dockapp, NULL);
+	gtk_widget_show_all(GTK_WIDGET(wmdock->box));
+
+	wmdock_msg_dialog(GTK_MESSAGE_INFO, _("Changes maybe not work properly until you restart XFCE!"));
+}
+
+
+static void wmdock_properties_chkpropbtn(GtkToggleButton *gtkChkPropButton, gpointer user_data)
+{
+	wmdock->propDispPropButton = gtk_toggle_button_get_active(gtkChkPropButton);
+
+	if(wmdock->propDispPropButton == FALSE) {
+		if(btnProperties) gtk_widget_destroy(btnProperties);
+		btnProperties = NULL;
+	}
+	else
+		wmdock_panel_draw_properties_button ();
+}
+
+
+static void wmdock_properties_chkaddonlywm(GtkToggleButton *gtkChkAddOnlyWM, gpointer user_data)
+{
+	wmdock->propDispAddOnlyWM = gtk_toggle_button_get_active(gtkChkAddOnlyWM);
+	gtk_widget_set_sensitive (GTK_WIDGET (prop.txtPatterns),
+			wmdock->propDispAddOnlyWM);
+}
+
+
+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_chkpanelofffreepositioning(GtkToggleButton *gtkChkPanelOffFreePositioning, gpointer user_data)
+{
+	wmdock->propPanelOffFreePositioning = gtk_toggle_button_get_active(gtkChkPanelOffFreePositioning);
+	wmdock->panelOffFpY = wmdock->panelOffFpX = G_MININT;
+	wmdock_order_dockapps(wmdock_get_primary_anchor_dockapp());
+}
+
+
+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->panelOffFpX = wmdock->panelOffFpY = G_MININT;
+	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)
+{
+	if((rcPanelOff = gtk_toggle_button_get_active(gtkChkPanelOff)) == TRUE) {
+		wmdock->anchorPos = get_default_anchor_postion();
+		wmdock_set_prop_paneloff(TRUE);
+	} else {
+		wmdock_set_prop_paneloff(FALSE);
+	}
+
+	if(g_list_length(wmdock->dapps)) {
+		wmdock_msg_dialog(GTK_MESSAGE_INFO, _("Changes will take effect when you restart XFCE!"));
+	} else {
+		/* If no dockapp is started enable/disable panel off mode. */
+		wmdock->propPanelOff = rcPanelOff;
+	}
+}
+
+
+static gboolean wmdock_properties_refresh_dapp_icon()
+{
+	GdkPixmap *pm = NULL;
+	DockappNode *dapp = NULL;
+	gboolean ret;
+
+	if(prop.dlg && prop.image && prop.cbx) {
+		dapp = DOCKAPP(g_list_nth_data(wmdock->dapps,
+				gtk_combo_box_get_active(GTK_COMBO_BOX(prop.cbx))));
+		if(dapp) {
+			pm = gdk_pixmap_foreign_new (dapp->i);
+			if(pm) {
+				gtk_image_set_from_pixmap (GTK_IMAGE(prop.image), pm, NULL);
+				gtk_widget_show(prop.image);
+				g_object_unref (G_OBJECT(pm));
+			}
+			else {
+				gtk_image_set_from_pixbuf (GTK_IMAGE(prop.image), gdkPbTileDefault);
+				gtk_widget_show(prop.image);
+				/* Check if the window is gone. */
+				if(!wnck_window_get (dapp->i)) {
+					ret = FALSE;
+					wmdock_dapp_closed(dapp->s, dapp);
+				}
+			}
+		}
+
+		ret = TRUE;
+	} else {
+		ret = FALSE;
+		debug("props.c: wmdock_properties_refresh_dapp_icon status changed to FALSE");
+	}
+
+	return (ret);
+}
+
+
+static void wmdock_properties_changed (GtkWidget *gtkComboBox, GtkWidget *gtkTxtCmd)
+{
+	DockappNode *dapp = NULL;
+
+
+	dapp = DOCKAPP(g_list_nth_data(wmdock->dapps, gtk_combo_box_get_active(GTK_COMBO_BOX(gtkComboBox))));
+	if(dapp) {
+		debug("props.c: changed, %s selected:", dapp->name);
+
+		gtk_entry_set_text(GTK_ENTRY(gtkTxtCmd), dapp->cmd);
+
+		wmdock_properties_refresh_dapp_icon();
+	}
+}
+
+
+static void wmdock_properties_moveup (GtkWidget *gtkBtnMoveUp, GtkWidget *gtkComboBox)
+{
+	DockappNode *dapp = NULL;
+	gint pos;
+
+	pos = gtk_combo_box_get_active(GTK_COMBO_BOX(gtkComboBox));
+
+	if(g_list_length(wmdock->dapps) > 1 && pos > 0) {
+		dapp = DOCKAPP(g_list_nth_data(wmdock->dapps, pos));
+
+		if(dapp) {
+			wmdock->dapps = g_list_remove_all(wmdock->dapps, dapp);
+			wmdock->dapps = g_list_insert(wmdock->dapps, dapp, pos - 1);
+			gtk_combo_box_remove_text(GTK_COMBO_BOX(gtkComboBox), pos);
+			gtk_combo_box_insert_text(GTK_COMBO_BOX(gtkComboBox), pos - 1, dapp->name);
+			gtk_combo_box_set_active(GTK_COMBO_BOX(gtkComboBox), pos - 1);
+			gtk_box_reorder_child(GTK_BOX(wmdock->box), GTK_WIDGET(dapp->tile), pos - 1);
+
+			g_list_foreach(wmdock->dapps, (GFunc)wmdock_redraw_dockapp, NULL);
+			debug("prop.c: Move up `%s' (now at pos: %d)", dapp->name, pos - 1);
+		}
+	}
+}
+
+
+static void wmdock_properties_movedown (GtkWidget *gtkBtnMoveDown, GtkWidget *gtkComboBox)
+{
+	DockappNode *dapp = NULL;
+	gint pos;
+
+	pos = gtk_combo_box_get_active(GTK_COMBO_BOX(gtkComboBox));
+
+	if(g_list_length(wmdock->dapps) > 1 && pos < g_list_length(wmdock->dapps) - 1) {
+		dapp = DOCKAPP(g_list_nth_data(wmdock->dapps, pos));
+
+		if(dapp) {
+			wmdock->dapps = g_list_remove_all(wmdock->dapps, dapp);
+			wmdock->dapps = g_list_insert(wmdock->dapps, dapp, pos + 1);
+			gtk_combo_box_remove_text(GTK_COMBO_BOX(gtkComboBox), pos);
+			gtk_combo_box_insert_text(GTK_COMBO_BOX(gtkComboBox), pos + 1, dapp->name);
+			gtk_combo_box_set_active(GTK_COMBO_BOX(gtkComboBox), pos + 1);
+			gtk_box_reorder_child(GTK_BOX(wmdock->box), GTK_WIDGET(dapp->tile), pos + 1);
+
+			g_list_foreach(wmdock->dapps, (GFunc)wmdock_redraw_dockapp, NULL);
+			debug("prop.c: Move down `%s' (now at pos: %d)", dapp->name, pos + 1);
+		}
+	}
+}
+
+
+static void wmdock_properties_savecmd (GtkWidget *gtkTxtCmd, GdkEventKey *event, GtkWidget *gtkComboBox)
+{
+	DockappNode *dapp = NULL;
+	gint pos;
+	gchar *_cmd = NULL;
+
+	pos = gtk_combo_box_get_active(GTK_COMBO_BOX(gtkComboBox));
+
+	dapp = DOCKAPP(g_list_nth_data(wmdock->dapps, pos));
+	if(dapp) {
+		if((_cmd = g_strdup(gtk_entry_get_text(GTK_ENTRY(gtkTxtCmd))))) {
+			g_free(dapp->cmd);
+			dapp->cmd = _cmd;
+		}
+	}
+}
+
+
+static void wmdock_properties_dialog_response (GtkWidget  *gtkDlg, gint response)
+{
+	DockappNode *dapp = NULL;
+	gint pos;
+
+	if(!gtkDlg) return;
+
+	switch(response) {
+	case GTK_RESPONSE_NO: /* Remove dockapp */
+		if(g_list_length(wmdock->dapps) > 0 && prop.cbx) {
+			pos = gtk_combo_box_get_active(GTK_COMBO_BOX(prop.cbx));
+
+			dapp = DOCKAPP(g_list_nth_data(wmdock->dapps, pos));
+			if(dapp)
+				wmdock_destroy_dockapp(dapp);
+		}
+		break;
+
+	default:
+		/* Backup the value of the dockapp filter. */
+		if(wmdock->propDispAddOnlyWM) {
+			if(wmdock->filterList) g_free(wmdock->filterList);
+			wmdock->filterList = g_strdup(gtk_entry_get_text(GTK_ENTRY(prop.txtPatterns)));
+		}
+
+		xfce_panel_plugin_unblock_menu (wmdock->plugin);
+		gtk_widget_destroy (gtkDlg);
+
+		debug("props.c: properties dlg closed");
+
+		prop.dlg = prop.cbx = prop.txtCmd = prop.image = NULL;
+		break;
+	}
+}
+
+
+static void wmdock_properties_dialog_called_from_widget(GtkWidget *widget, XfcePanelPlugin *plugin)
+{
+	wmdock_properties_dialog(plugin);
+}
+
+
+void wmdock_panel_draw_properties_button ()
+{
+	if(!btnProperties && wmdock->propDispPropButton == TRUE) {
+		btnProperties = xfce_create_panel_button();
+		gtk_box_pack_start(GTK_BOX(wmdock->panelBox),
+				btnProperties, FALSE, FALSE, 0);
+		gtk_box_reorder_child(GTK_BOX(wmdock->panelBox), btnProperties, 0);
+
+		g_signal_connect (G_OBJECT(btnProperties), "pressed",
+				G_CALLBACK (wmdock_properties_dialog_called_from_widget),
+				wmdock->plugin);
+
+		gtk_widget_show(GTK_WIDGET(btnProperties));
+	}
+}
+
+
+void wmdock_error_dialog_response (GtkWidget  *gtkDlg, gint response)
+{
+	gtk_widget_destroy (gtkDlg);
+}
+
+
+void wmdock_refresh_properties_dialog()
+{
+	gint pos = 0;
+
+	if(!prop.dlg || !prop.cbx || !prop.txtCmd) return;
+
+	/* Cleanup the old list */
+	while((pos = gtk_combo_box_get_active (GTK_COMBO_BOX(prop.cbx)))
+			!= -1) {
+		gtk_combo_box_remove_text(GTK_COMBO_BOX(prop.cbx), pos);
+		gtk_combo_box_set_active (GTK_COMBO_BOX(prop.cbx), 0);
+	}
+
+	gtk_combo_box_popdown (GTK_COMBO_BOX(prop.cbx));
+	if(g_list_length(wmdock->dapps) > 0) {
+		gtk_widget_set_sensitive (prop.txtCmd, TRUE);
+
+		g_list_foreach(wmdock->dapps, (GFunc) wmdock_properties_fillcmbx, prop.cbx);
+
+
+	} else {
+		gtk_combo_box_append_text (GTK_COMBO_BOX(prop.cbx),
+				_("No dockapp is running!"));
+
+		gtk_widget_set_state(prop.txtCmd, GTK_STATE_INSENSITIVE);
+		gtk_entry_set_text(GTK_ENTRY(prop.txtCmd), "");
+
+		gdkPbIcon = gdk_pixbuf_new_from_xpm_data((const char**)
+				xfce4_wmdock_plugin_xpm);
+
+		gtk_image_set_from_pixbuf (GTK_IMAGE(prop.image), gdkPbIcon);
+
+		g_object_unref (G_OBJECT (gdkPbIcon));
+	}
+
+	gtk_combo_box_set_active(GTK_COMBO_BOX(prop.cbx), 0);
+
+	gtk_widget_show (prop.image);
+	gtk_widget_show (prop.cbx);
+	gtk_widget_show (prop.txtCmd);
+}
+
+
+void wmdock_properties_dialog(XfcePanelPlugin *plugin)
+{
+	if(prop.dlg) return; /* Return if properties dialog is already open. */
+
+	memset(&prop, 0, sizeof(prop));
+	xfce_panel_plugin_block_menu (plugin);
+
+	/* Create the configure dialog. */
+	prop.dlg = xfce_titled_dialog_new_with_buttons (_("WMdock"),
+			GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (plugin))),
+			GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
+			_("Remove dockapp"), GTK_RESPONSE_NO,
+			GTK_STOCK_CLOSE, GTK_RESPONSE_OK,
+			NULL);
+
+	gtk_window_set_position   (GTK_WINDOW (prop.dlg), GTK_WIN_POS_CENTER);
+	gtk_window_set_icon_name  (GTK_WINDOW (prop.dlg), "xfce4-settings");
+
+	g_signal_connect (prop.dlg, "response",
+			G_CALLBACK (wmdock_properties_dialog_response),
+			NULL);
+
+	/* Create the layout containers. */
+	prop.hbox = gtk_hbox_new(FALSE, 6);
+	gtk_box_pack_start (GTK_BOX (GTK_DIALOG (prop.dlg)->vbox), prop.hbox, FALSE, FALSE, 0);
+	gtk_container_set_border_width (GTK_CONTAINER (prop.hbox), 4);
+
+	prop.frmGeneral = gtk_frame_new(_("General settings"));
+	prop.frmDetect = gtk_frame_new(_("Dockapp detection"));
+	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.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);
+	gtk_container_set_border_width (GTK_CONTAINER (prop.vbox), 2);
+	gtk_container_set_border_width (GTK_CONTAINER (prop.vbox2), 2);
+	gtk_box_pack_start (GTK_BOX (prop.hbox), prop.vbox, FALSE, FALSE, 0);
+	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);
+	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);
+
+	prop.imageTile = gtk_image_new_from_pixbuf(gdkPbTileDefault);
+	prop.image = gtk_image_new_from_pixbuf (gdkPbIcon);
+
+	g_object_unref (G_OBJECT (gdkPbIcon));
+
+	gtk_container_add(GTK_CONTAINER(prop.imageContainer), prop.image);
+	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);
+
+	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);
+	}
+
+	prop.lblSel = gtk_label_new (_("Select dockapp to configure:"));
+	gtk_misc_set_alignment (GTK_MISC (prop.lblSel), 0, 0);
+	gtk_box_pack_start (GTK_BOX(prop.vbox2), prop.lblSel, FALSE, FALSE, 0);
+
+	/* Create the dockapp chooser combobox */
+	prop.cbx = gtk_combo_box_new_text();
+
+	gtk_box_pack_start (GTK_BOX (prop.vbox2), prop.cbx, FALSE, TRUE, 0);
+
+	prop.lblCmd = gtk_label_new (_("Shell command:"));
+	gtk_misc_set_alignment (GTK_MISC (prop.lblCmd), 0, 0);
+	gtk_box_pack_start (GTK_BOX(prop.vbox2), prop.lblCmd, FALSE, FALSE, 0);
+	prop.txtCmd = gtk_entry_new();
+	if(g_list_length(wmdock->dapps) > 0) {
+		gtk_editable_set_editable(GTK_EDITABLE(prop.txtCmd), TRUE);
+	} else {
+		gtk_editable_set_editable(GTK_EDITABLE(prop.txtCmd), FALSE);
+	}
+	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 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.chkPanelOffFreePositioning = gtk_check_button_new_with_label(_("Enable free positioning of the first dockapp on the screen."));
+	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_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_toggle_button_set_active((GtkToggleButton *) prop.chkPanelOffFreePositioning, wmdock->propPanelOffFreePositioning);
+
+	gtk_container_add(GTK_CONTAINER(prop.frmGeneral), prop.vboxGeneral);
+	gtk_container_add(GTK_CONTAINER(prop.frmDetect), prop.vboxDetect);
+	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.chkPanelOffFreePositioning, FALSE, FALSE, 0);
+	gtk_box_pack_start (GTK_BOX(prop.vboxPanelOffOpts), prop.hboxPanelOffOpts, FALSE, FALSE, 0);
+	prop.lblPanelOffHint = gtk_label_new (_("Hint: Is the first dockapp covered by a XFCE panel, please try to move the plugin\nto this panel to correct this problem."));
+	gtk_box_pack_start (GTK_BOX(prop.vboxPanelOffOpts), prop.lblPanelOffHint, FALSE, FALSE, 0);
+
+	prop.tblPanelOff = gtk_table_new(2, 2, TRUE);
+	prop.lblPanelOffPlacement = gtk_label_new (_("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_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);
+
+	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 ( rcPanelOff == FALSE ) {
+		/* Disable advanced panel options is the panel used. */
+		wmdock_set_prop_paneloff(FALSE);
+	} else {
+		wmdock_set_prop_paneloff(TRUE);
+	}
+
+	/* 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.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.chkPanelOffFreePositioning), "toggled", G_CALLBACK(wmdock_properties_chkpanelofffreepositioning), 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);
+
+	if(g_list_length(wmdock->dapps) > 0)
+		wmdock_properties_changed(prop.cbx, prop.txtCmd);
+
+	gtk_widget_show_all (prop.dlg);
+}
diff --git a/panel-plugin/wmdock.h b/panel-plugin/props.h
similarity index 50%
copy from panel-plugin/wmdock.h
copy to panel-plugin/props.h
index f8c42c9..ddf072b 100644
--- a/panel-plugin/wmdock.h
+++ b/panel-plugin/props.h
@@ -1,9 +1,8 @@
 /* wmdock xfce4 plugin by Andre Ellguth
- *
- * $Id$
+ * Properties dialog - Header.
  *
  * Authors:
- *   Andre Ellguth <ellguth at ibh.de>
+ *   Andre Ellguth <andre at ellguth.com>
  *
  * License:
  *   This program is free software; you can redistribute it and/or modify
@@ -21,40 +20,13 @@
  *   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-#ifndef __WMDOCK_H__
-#define __WMDOCK_H__
-
-#include <gtk/gtk.h>
-#include <libxfce4panel/libxfce4panel.h>
-
-#define WNCK_I_KNOW_THIS_IS_UNSTABLE
-#include <libwnck/libwnck.h>
-
-typedef struct _dockapp {
- GtkSocket       *s;
- GdkNativeWindow i;
- GtkWidget       *bg;
- GtkWidget       *tile;
- gchar           *name;
- gchar           *cmd;
-} DockappNode;
-
-typedef struct {
- XfcePanelPlugin *plugin;
-
- GtkWidget       *eventBox;
-	
- /* Plugin specific definitions */
- GtkWidget       *align;
- GtkWidget       *box;
- GtkWidget       *panelBox;
-	
- gboolean        propDispTile;
- gboolean        propDispPropButton;
- gboolean        propDispAddOnlyWM;
- gchar           *filterList;
+#ifndef __PROPS_H__
+#define __PROPS_H__
 
- GList           *dapps;
-} WmdockPlugin;
+/* prototypes */
+void wmdock_properties_dialog(XfcePanelPlugin *plugin);
+void wmdock_refresh_properties_dialog();
+void wmdock_panel_draw_properties_button();
+void wmdock_error_dialog_response (GtkWidget  *, gint);
 
-#endif /* __WMDOCK_H__ */
+#endif /* __PROPS_H__ */
diff --git a/panel-plugin/rcfile.c b/panel-plugin/rcfile.c
new file mode 100644
index 0000000..d804fff
--- /dev/null
+++ b/panel-plugin/rcfile.c
@@ -0,0 +1,235 @@
+/* wmdock xfce4 plugin by Andre Ellguth
+ * Configuration file handling.
+ *
+ * Authors:
+ *   Andre Ellguth <andre at ellguth.com>
+ *
+ * License:
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this package; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include <X11/Xatom.h>
+#include <X11/Xutil.h>
+
+#define WNCK_I_KNOW_THIS_IS_UNSTABLE
+#include <libwnck/libwnck.h>
+
+#include <gtk/gtk.h>
+#include <libxfce4util/libxfce4util.h>
+#include <libxfcegui4/libxfcegui4.h>
+#include <libxfce4panel/libxfce4panel.h>
+
+#include "extern.h"
+#include "rcfile.h"
+#include "wmdock.h"
+#include "debug.h"
+#include "dockapp.h"
+#include "misc.h"
+#include "props.h"
+
+
+void wmdock_read_rc_file (XfcePanelPlugin *plugin)
+{
+	gchar     *file = NULL;
+	XfceRc    *rc = NULL;
+	gint      i = 0, j = 0, gluePos = 0;
+	gint64    n = 0;
+	gchar     *glueName = NULL;
+	DockappNode *dapp = NULL;
+	DockappNode **launched = NULL;
+	gchar     **glueList = NULL;
+	gchar     **glueInfo = NULL;
+
+	if (!(file = xfce_panel_plugin_lookup_rc_file (plugin))) return;
+
+	rc = xfce_rc_simple_open (file, TRUE);
+	g_free(file);
+	if(!rc)
+		return;
+
+	rcCmds                     = xfce_rc_read_list_entry(rc, RCKEY_CMDLIST, RC_LIST_DELIMITER);
+	wmdock->propDispTile       = xfce_rc_read_bool_entry (rc, RCKEY_DISPTILE, RCDEFAULT_DISPTILE);
+	wmdock->propDispPropButton = xfce_rc_read_bool_entry (rc, RCKEY_DISPPROPBTN, RCDEFAULT_DISPPROPBTN);
+	wmdock->propDispAddOnlyWM  = xfce_rc_read_bool_entry (rc, RCKEY_DISPADDONLYWM, RCDEFAULT_DISPADDONLYWM);
+	if(wmdock->filterList) g_free(wmdock->filterList);
+	wmdock->filterList         = g_strdup(xfce_rc_read_entry (rc, RCKEY_DAFILTER, DOCKAPP_FILTER_PATTERN));
+	rcPanelOff                 = wmdock->propPanelOff = xfce_rc_read_bool_entry (rc, RCKEY_PANELOFF, RCDEFAULT_PANELOFF);
+	wmdock->propPanelOffIgnoreOffset = xfce_rc_read_bool_entry (rc, RCKEY_PANELOFFIGNOREOFFSET, RCDEFAULT_PANELOFFIGNOREOFFSET);
+	wmdock->propPanelOffKeepAbove    = xfce_rc_read_bool_entry (rc, RCKEY_PANELOFFKEEPABOVE, RCDEFAULT_PANELOFFKEEPABOVE);
+	wmdock->propPanelOffFreePositioning = xfce_rc_read_bool_entry (rc, RCKEY_PANELOFFFREEPOSITIONING, RCDEFAULT_PANELOFFFREEPOSITIONING);
+	wmdock->panelOffFpX        = xfce_rc_read_int_entry(rc, RCKEY_PANELOFFFPX, RCDEFAULT_PANELOFFFPX);
+	wmdock->panelOffFpY        = xfce_rc_read_int_entry(rc, RCKEY_PANELOFFFPY, RCDEFAULT_PANELOFFFPY);
+	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, RCDEFAULT_ANCHORPOS);
+	xfce_rc_close (rc);
+
+	if(G_LIKELY(rcCmds != NULL)) {
+		if(!(launched = g_malloc0(sizeof (DockappNode *) * (g_strv_length(rcCmds)))))
+				return;
+
+		/* Wait 1 seconds as workaround for double XMap problems. */
+		g_usleep(1 * G_USEC_PER_SEC);
+		for (i = 0; rcCmds[i]; i++) {
+			debug("rcfile.c: Setup `%s'\n", rcCmds[i]);
+
+			if(wmdock_startup_dockapp(rcCmds[i]) != TRUE) {
+				launched[i] = NULL;
+				wmdock_msg_dialog(GTK_MESSAGE_ERROR, _("Failed to start `%s'!"), rcCmds[i]);
+			} else {
+				/* Create some dummy widget entries to locate the right position on
+				 * window swallow up.
+				 */
+				dapp = g_new0(DockappNode, 1);
+				dapp->name = NULL;
+				dapp->cmd = rcCmds[i];
+
+				dapp->s = GTK_SOCKET(gtk_socket_new());
+				dapp->tile = wmdock_create_tile_from_socket(dapp);
+
+				wmdock->dapps = g_list_append(wmdock->dapps, dapp);
+				launched[i] = dapp;
+
+				if( ! IS_PANELOFF(wmdock) ) {
+					gtk_box_pack_start(GTK_BOX(wmdock->box), GTK_WIDGET(dapp->tile), FALSE, FALSE, 0);
+				} else  {
+					/* If is possible, restore the old position of the dockapps in panel off mode. */
+					if(! wmdock_get_parent_dockapp(dapp) ) {
+						if(g_list_previous(g_list_last(wmdock->dapps))) {
+							DOCKAPP(((GList *) g_list_previous(g_list_last(wmdock->dapps)))->data)->glue[wmdock_get_default_gluepos()] = dapp;
+						}
+					}
+				}
+			}
+		}
+
+		if( IS_PANELOFF( wmdock ) && g_strv_length(rcCmds) == g_strv_length(glueList) ) {
+			for (i = 0; glueList[i]; i++) {
+				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] != ':')
+						continue;
+					if((gluePos = wmdock_get_glue_position(&glueName[1])) == -1)
+						continue;
+
+					launched[i]->glue[gluePos] = launched[(gint) n];
+					debug("rcfile.c: Restored panel off position. (`%s', %s = %d)", launched[i]->cmd, &glueName[1], gluePos);
+				}
+				g_strfreev(glueInfo);
+			}
+		}
+
+		g_free(launched);
+	} /* rcCmds != NULL */
+
+	if(glueList)
+		g_strfreev(glueList);
+}
+
+
+void wmdock_write_rc_file (XfcePanelPlugin *plugin)
+{
+	gchar       *file = NULL, *str = NULL;
+	XfceRc      *rc;
+	gchar       **cmdList = NULL;
+	gchar       **glueList = NULL;
+	gchar       buf[BUF_MAX];
+	GList       *dapps;
+	DockappNode *dapp = NULL;
+	gint        i = 0, gluePos = 0, n = 0;
+
+	if (!(file = xfce_panel_plugin_save_location (plugin, TRUE))) return;
+
+	rc = xfce_rc_simple_open (file, FALSE);
+	g_free (file);
+
+	if (!rc)
+		return;
+
+	if(g_list_length (wmdock->dapps) > 0) {
+		cmdList = g_malloc0(sizeof (gchar *) * (g_list_length (wmdock->dapps) + 1));
+		if ( IS_PANELOFF(wmdock) )
+			glueList = g_malloc0(sizeof (gchar *) * (g_list_length (wmdock->dapps) + 1));
+
+		for(dapps = g_list_first(wmdock->dapps) ; dapps; dapps = g_list_next(dapps)) {
+			dapp = DOCKAPP(dapps->data);
+			if((i = g_list_index(wmdock->dapps, (gconstpointer) dapp)) == -1)
+				continue;
+			cmdList[i] = dapp->cmd ? g_strdup(dapp->cmd) : NULL;
+			if( IS_PANELOFF(wmdock) ) {
+				buf[0] = '\0';
+				for(gluePos = 0; gluePos < GLUE_MAX; gluePos++) {
+					if(dapp->glue[gluePos] && (n = g_list_index(wmdock->dapps, (gconstpointer) dapp->glue[gluePos])) != -1) {
+						/* ChildIndex1(n):position,ChildIndex2:postion,... */
+						if(strnlen((const char *) buf, sizeof(buf)-1) > 0)
+							str = g_strdup_printf("%s%d:%s", RC_GLUE_DELIMITER, n, wmdock_get_glue_name(gluePos));
+						else
+							str = g_strdup_printf("%d:%s", n, wmdock_get_glue_name(gluePos));
+						g_strlcat(buf, str, sizeof(buf));
+						g_free(str);
+					}
+				}
+				glueList[i] = g_strdup(buf);
+			}
+		}
+
+		xfce_rc_write_list_entry(rc, RCKEY_CMDLIST, cmdList, RC_LIST_DELIMITER);
+		g_strfreev(cmdList);
+
+		if( IS_PANELOFF(wmdock) ) {
+			xfce_rc_write_list_entry(rc, RCKEY_GLUELIST, glueList, RC_LIST_DELIMITER);
+			g_strfreev(glueList);
+		} else if ( ! IS_PANELOFF(wmdock) || rcPanelOff == FALSE ) {
+			xfce_rc_delete_entry(rc, RCKEY_GLUELIST, TRUE);
+		}
+
+		xfce_rc_write_bool_entry (rc, RCKEY_DISPTILE, wmdock->propDispTile);
+		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);
+		if(rcPanelOff == FALSE) {
+			/* Reset the options to default. */
+			wmdock->propPanelOffFreePositioning = RCDEFAULT_PANELOFFFREEPOSITIONING;
+			wmdock->propPanelOffIgnoreOffset = RCDEFAULT_PANELOFFIGNOREOFFSET;
+			wmdock->propPanelOffKeepAbove = RCDEFAULT_PANELOFFKEEPABOVE;
+		}
+		xfce_rc_write_bool_entry (rc, RCKEY_PANELOFFIGNOREOFFSET, wmdock->propPanelOffIgnoreOffset);
+		xfce_rc_write_bool_entry (rc, RCKEY_PANELOFFKEEPABOVE, wmdock->propPanelOffKeepAbove);
+		xfce_rc_write_bool_entry (rc, RCKEY_PANELOFFFREEPOSITIONING, wmdock->propPanelOffFreePositioning);
+		if(wmdock->propPanelOffFreePositioning == TRUE) {
+			xfce_rc_write_int_entry (rc, RCKEY_PANELOFFFPX, wmdock->panelOffFpX);
+			xfce_rc_write_int_entry (rc, RCKEY_PANELOFFFPY, wmdock->panelOffFpY);
+		} else {
+			xfce_rc_delete_entry(rc, RCKEY_PANELOFFFPX, TRUE);
+			xfce_rc_delete_entry(rc, RCKEY_PANELOFFFPY, TRUE);
+		}
+		xfce_rc_write_int_entry (rc, RCKEY_ANCHORPOS, wmdock->anchorPos);
+		xfce_rc_write_entry(rc, RCKEY_DAFILTER, wmdock->filterList);
+	}
+
+	xfce_rc_close(rc);
+}
diff --git a/panel-plugin/rcfile.h b/panel-plugin/rcfile.h
new file mode 100644
index 0000000..c1c26cc
--- /dev/null
+++ b/panel-plugin/rcfile.h
@@ -0,0 +1,59 @@
+/* wmdock xfce4 plugin by Andre Ellguth
+ * rcfile.h
+ *
+ * Authors:
+ *   Andre Ellguth <andre at ellguth.com>
+ *
+ * License:
+ *   This program is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   This program is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with this package; if not, write to the Free Software
+ *   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
+ */
+
+#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_PANELOFFIGNOREOFFSET     (const gchar *) "paneloffignoreoffset"
+#define RCKEY_PANELOFFKEEPABOVE        (const gchar *) "paneloffkeepabove"
+#define RCKEY_PANELOFFFREEPOSITIONING  (const gchar *) "panelofffreepositioning"
+#define RCKEY_PANELOFFFPX              (const gchar *) "panelofffpx"
+#define RCKEY_PANELOFFFPY              (const gchar *) "panelofffpy"
+#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 *) ","
+
+#define RCDEFAULT_DISPTILE                (gboolean) TRUE
+#define RCDEFAULT_DISPPROPBTN             (gboolean) FALSE
+#define RCDEFAULT_DISPADDONLYWM           (gboolean) TRUE
+#define RCDEFAULT_PANELOFF                (gboolean) FALSE
+#define RCDEFAULT_PANELOFFIGNOREOFFSET    (gboolean) FALSE
+#define RCDEFAULT_PANELOFFKEEPABOVE       (gboolean) FALSE
+#define RCDEFAULT_PANELOFFFREEPOSITIONING (gboolean) FALSE
+#define RCDEFAULT_PANELOFFFPX             (gint) G_MININT
+#define RCDEFAULT_PANELOFFFPY             (gint) G_MININT
+#define RCDEFAULT_ANCHORPOS               (gint) -1
+
+/* Prototypes */
+void wmdock_read_rc_file (XfcePanelPlugin *);
+void wmdock_write_rc_file (XfcePanelPlugin *);
+
+#endif /* __RCFILE_H__ */
diff --git a/panel-plugin/wmdock.c b/panel-plugin/wmdock.c
index a144cb0..509bc8a 100644
--- a/panel-plugin/wmdock.c
+++ b/panel-plugin/wmdock.c
@@ -1,9 +1,7 @@
 /* wmdock xfce4 plugin by Andre Ellguth
  *
- * $Id$
- *
  * Authors:
- *   Andre Ellguth <ellguth at ibh.de>
+ *   Andre Ellguth <andre at ellguth.com>
  *
  * License:
  *   This program is free software; you can redistribute it and/or modify
@@ -37,1403 +35,194 @@
 #include <libxfce4panel/libxfce4panel.h>
 
 #include "wmdock.h"
-#include "xfce4-wmdock-plugin.xpm"
-#include "tile.xpm"
+#include "catchwindow.h"
+#include "debug.h"
+#include "dnd.h"
+#include "dockapp.h"
+#include "misc.h"
+#include "props.h"
+#include "rcfile.h"
 
+#include "tile.xpm"
 
-#define DEFAULT_DOCKAPP_WIDTH 64
-#define DEFAULT_DOCKAPP_HEIGHT 64
-#define FONT_WIDTH 4
-#define MAX_WAITCNT 10000
+#define FONT_WIDTH      4
+#define MAX_WAITCNT     10000
 #define WAITCNT_TIMEOUT 1000000
-#define BUF_MAX 4096
-/* Default filter for dockapps. All dockapps starting with "wm" or "as". */
-#define DOCKAPP_FILTER_PATTERN "^wm;^as"
-
-#define _BYTE 8
 
 Atom         XfceDockAppAtom;
-GtkWidget    *wmdockIcon     = NULL;
-GtkWidget    *btnProperties  = NULL;
-DockappNode  *dappProperties = NULL;
-GdkPixmap    *gdkPmTile      = NULL;
-GdkPixbuf    *gdkPbIcon      = NULL;
-WmdockPlugin *wmdock         = NULL;
-gchar        **rcCmds        = NULL;
-gint         rcCmdcnt        = 0;
-
-
-/* Properties dialog */
-static struct {
- GtkWidget *dlg;
- GtkWidget *vbox, *vbox2, *vboxGeneral, *vboxDetect;
- GtkWidget *hbox;
- GtkWidget *frmGeneral, *frmDetect;
- GtkWidget *lblSel, *lblCmd;
- GtkWidget *chkDispTile, *chkPropButton, *chkAddOnlyWM;
- GtkWidget *imageContainer, *container;
- GtkWidget *imageTile, *image;
- GtkWidget *txtCmd;
- GtkWidget *cbx;
- GtkWidget *btnMoveUp, *btnMoveDown, *txtPatterns;
-} prop;
-
-
-static GtkTargetEntry targetList[] = {
- { "INTEGER", 0, 0 }
-};
-static guint nTargets = G_N_ELEMENTS (targetList);
-
-
-/* Prototypes */
-static void wmdock_properties_dialog_called_from_widget(GtkWidget *, XfcePanelPlugin *);
-static void wmdock_properties_dialog(XfcePanelPlugin *);
-static void wmdock_redraw_dockapp(DockappNode *);
-static void wmdock_destroy_dockapp(DockappNode *);
-
-
-#ifdef DEBUG
-/* fp needed for debug */
-FILE           *fp = (FILE *) NULL;
-#endif
-
-
-static gboolean comp_str_with_pattern(const gchar *str, gchar *pattern, gsize s)
-{
- gboolean    r = FALSE;
-
- if(!str || !pattern) return FALSE;
- 
-#if (GLIB_MAJOR_VERSION >= 2 && GLIB_MINOR_VERSION >= 14)
- GRegex *regex = g_regex_new (pattern, G_REGEX_CASELESS, 0, NULL);
- if(regex) {
-  r = g_regex_match (regex, str, 0, NULL);
-  g_regex_unref (regex);
- }
-#else
- gsize    maxsize;
- gint     i;
-
- maxsize = s > strlen(pattern) ? strlen(pattern) : s;
-
- for(i=0; i<strlen(str)&&strlen(&str[i]) >= maxsize;i++)
-  if(!g_ascii_strncasecmp (&str[i], pattern, maxsize)) {
-   r = TRUE;
-   break;
-  }
-#endif
-
- return r;
-}
-
-
-static gboolean comp_dockapp_with_filterlist(const gchar *name)
-{
- gchar **patterns = NULL;
- gint i=0;
- gsize s=0;
- gboolean r = FALSE;
-
- if(!wmdock->filterList) return FALSE;
-
- patterns = g_strsplit (wmdock->filterList, ";", 0);
- if(!patterns) return FALSE;
- while(patterns[i]) {
-  s = strlen(patterns[i]) > 256 ? 256 : strlen(patterns[i]);
-  if(s > 0 && 
-     (r=comp_str_with_pattern(name, patterns[i], s)) == TRUE)
-   break;
-  i++;
- }
-
- g_strfreev(patterns);
- return r;
-}
-
-
-static gboolean has_dockapp_hint(WnckWindow *w)
-{
- Atom atype;
- int afmt;
- unsigned long int nitems;
- unsigned long int naft;
- gboolean r = FALSE;
- unsigned char *dat = NULL;
-	
-	
- gdk_error_trap_push();
- if (XGetWindowProperty(
-			GDK_DISPLAY_XDISPLAY(gdk_display_get_default()),
-			wnck_window_get_xid(w), XfceDockAppAtom, 0, 1, False,
-			XA_CARDINAL, &atype, &afmt, &nitems, &naft, &dat) == Success) {
-  if (nitems==1 && ((long int *) dat)[0]==1) {
-   r = TRUE;
-  }
-  XFree(dat);
- }
- XSync(GDK_DISPLAY_XDISPLAY(gdk_display_get_default()),False);
-   	
- gdk_error_trap_pop();
-
- return (r);
-}
-
-
-static void set_xsmp_support(WnckWindow *w)
-{
- /* Workaround to skip the XFCE4 session manager. If the window
-  * has this X text property set, the XFCE4 session manager will not
-  * automaticly start the dockapp after startup twice. */
-
- XTextProperty tp;
- static Atom _XA_SM_CLIENT_ID = None;
-
- _XA_SM_CLIENT_ID = XInternAtom (GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), "SM_CLIENT_ID", False);
- 
- 
- tp.value = (unsigned char *) strdup("SM_CLIENT_ID");
- tp.encoding = XA_STRING;
- tp.format = 8;
- tp.nitems = 1;
-
- XSetTextProperty(GDK_DISPLAY_XDISPLAY(gdk_display_get_default()),
-		  wnck_window_get_xid(w),
-		  &tp, _XA_SM_CLIENT_ID);
-
- XFree((unsigned char *)tp.value);
-}
-
-
-static GdkPixbuf *get_icon_from_xpm_scaled(const char **xpmData, gint width, gint height)
-{
- GdkPixbuf *gdkPb = NULL;
- GdkPixbuf *gdkPbScaled = NULL;
-	
- gdkPb = gdk_pixbuf_new_from_xpm_data (xpmData);
-	
- gdkPbScaled = gdk_pixbuf_scale_simple(gdkPb, width, height, 
-				       GDK_INTERP_BILINEAR);
-	
- g_object_unref (G_OBJECT (gdkPb));
-	
- return(gdkPbScaled);
-}
-
-
-static void drag_begin_handl (GtkWidget *widget, GdkDragContext *context,
-			      gpointer dapp)
-{
- gdkPbIcon = get_icon_from_xpm_scaled((const char **) xfce4_wmdock_plugin_xpm, 
-				      DEFAULT_DOCKAPP_WIDTH/2,
-				      DEFAULT_DOCKAPP_HEIGHT/2);
-
- gtk_drag_set_icon_pixbuf (context, gdkPbIcon, 0, 0);
-
- g_object_unref (G_OBJECT(gdkPbIcon)); 
-}
-
-#if (GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 12)
-static gboolean drag_failed_handl(GtkWidget *widget, GdkDragContext *context,
-				  GtkDragResult result, gpointer dapp)
-{
- GtkWidget *gtkDlg;
-
- if(result == GTK_DRAG_RESULT_NO_TARGET && dapp) {
-  gtkDlg = gtk_message_dialog_new(GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (wmdock->plugin))), 
-				  GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
-				  GTK_MESSAGE_QUESTION,
-				  GTK_BUTTONS_YES_NO,
-				  _("Do you want remove the dockapp \"%s\"?"),
-				  ((DockappNode *) dapp)->name);
-
-  if(gtk_dialog_run (GTK_DIALOG(gtkDlg)) == GTK_RESPONSE_YES)
-   wmdock_destroy_dockapp((DockappNode *) dapp);
-
-  gtk_widget_destroy (GTK_WIDGET(gtkDlg));
- }
-#ifdef DEBUG
- fprintf(fp, "Drag failed of dockapp %s\n", ((DockappNode *) dapp)->name);
- fflush(fp);
-#endif
-
- return TRUE;
-}
-#endif
-
-
-static gboolean drag_drop_handl (GtkWidget *widget, GdkDragContext *context,
-				 gint x, gint y, guint time, gpointer dapp)
-{
- gboolean        is_valid_drop_site;
- GdkAtom         target_type;
-
- is_valid_drop_site = TRUE;
-
- if (context-> targets)
-  {
-   target_type = GDK_POINTER_TO_ATOM
-    (g_list_nth_data (context-> targets, 0));
-
-   gtk_drag_get_data (widget,context, target_type, time);
-  }
-
- else
-  {
-   is_valid_drop_site = FALSE;
-  }
-
- return  is_valid_drop_site;
-}
-
-
-
-static void drag_data_received_handl (GtkWidget *widget,
-				      GdkDragContext *context, gint x, gint y,
-				      GtkSelectionData *selection_data,
-				      guint target_type, guint time,
-				      gpointer dapp)
-{
- glong *_idata;
- gboolean dnd_success = FALSE;
- GList *dappsSrc = NULL;
- GList *dappsDst = NULL;
-
- if(target_type == 0) {
-  _idata = (glong*) selection_data-> data;
-#ifdef DEBUG  
-  fprintf(fp, "DnD integer received: %ld\n", *_idata);
-  fflush(fp);
-#endif
-  dnd_success = TRUE;
-
-  if(dapp) {
-   dappsSrc = g_list_nth(wmdock->dapps, *_idata);
-   dappsDst = g_list_find(wmdock->dapps, (DockappNode *) dapp);
-
-   if(dappsSrc->data != dappsDst->data) {
-
-#ifdef DEBUG  
-    fprintf(fp, "DnD src dockapp name: %s\n", 
-	    ((DockappNode *) dappsSrc->data)->name);
-    fprintf(fp, "DnD dst dockapp name: %s\n", 
-	    ((DockappNode *) dapp)->name);
-    fflush(fp);
-#endif
-
-    dappsDst->data = dappsSrc->data;
-    dappsSrc->data = dapp;
-
-#ifdef DEBUG  
-    fprintf(fp, "DnD src index: %d\n", 
-	    g_list_index (wmdock->dapps, dappsSrc->data));
-    fprintf(fp, "DnD dst index: %d\n", 
-	    g_list_index (wmdock->dapps, dappsDst->data));
-    fflush(fp);
-#endif
-    
-    gtk_box_reorder_child(GTK_BOX(wmdock->box), 
-			  GTK_WIDGET(((DockappNode *) dappsSrc->data)->tile), 
-			  g_list_index (wmdock->dapps, dappsSrc->data));
-    gtk_box_reorder_child(GTK_BOX(wmdock->box), 
-			  GTK_WIDGET(((DockappNode *) dappsDst->data)->tile), 
-			  g_list_index (wmdock->dapps, dappsDst->data));
-
-    g_list_foreach(wmdock->dapps, (GFunc)wmdock_redraw_dockapp, NULL);   
-   }
-  }
-
- }
-
- gtk_drag_finish (context, dnd_success, FALSE, time);
-
-}
-
-
-
-static void drag_data_get_handl (GtkWidget *widget, GdkDragContext *context,
-				 GtkSelectionData *selection_data, 
-				 guint target_type, guint time, 
-				 gpointer dapp)
-{
- gint index;
-
- if(target_type == 0 && dapp) {
-  index = g_list_index (wmdock->dapps, (DockappNode *) dapp);
-
-  gtk_selection_data_set (selection_data, selection_data->target, 
-			  sizeof(index) * _BYTE,
-			  (guchar*) &index, sizeof (index));
-
-#ifdef DEBUG  
-  fprintf(fp, "DnD Integer sent: %ld\n", index);
-  fflush(fp);
-#endif
- }
-}
-
-
-
-static void wmdock_panel_draw_wmdock_icon (gboolean redraw)
-{
- gdkPbIcon = get_icon_from_xpm_scaled((const char **) xfce4_wmdock_plugin_xpm, 
-				      xfce_panel_plugin_get_size (wmdock->plugin) - 2,
-				      xfce_panel_plugin_get_size (wmdock->plugin) - 2);
- if(redraw == TRUE && wmdockIcon) {
-  gtk_image_set_from_pixbuf (GTK_IMAGE(wmdockIcon), gdkPbIcon);
- } else {
-  if(wmdockIcon) gtk_widget_destroy(wmdockIcon);
-  wmdockIcon = gtk_image_new_from_pixbuf (gdkPbIcon);
-
-  gtk_box_pack_start(GTK_BOX(wmdock->box), GTK_WIDGET(wmdockIcon), 
-		     FALSE, FALSE, 0);
- }
- g_object_unref (G_OBJECT (gdkPbIcon));
-
- gtk_widget_show(GTK_WIDGET(wmdockIcon));
-}
-
-
-static void wmdock_panel_draw_properties_button ()
-{
- if(!btnProperties && wmdock->propDispPropButton == TRUE) {
-  btnProperties = xfce_create_panel_button();
-  gtk_box_pack_start(GTK_BOX(wmdock->panelBox), 
-		     btnProperties, FALSE, FALSE, 0);
-  gtk_box_reorder_child(GTK_BOX(wmdock->panelBox), btnProperties, 0);
-
-  g_signal_connect (G_OBJECT(btnProperties), "pressed", 
-		    G_CALLBACK (wmdock_properties_dialog_called_from_widget),
-		    wmdock->plugin);
- 
-  gtk_widget_show(GTK_WIDGET(btnProperties));
- }
-}
-
-
-static void wmdock_fill_cmbx(DockappNode *dapp, GtkWidget *gtkComboBox)
-{
-
- if(gtkComboBox) {
-#ifdef DEBUG
-  fprintf(fp, "wmdock: %s append to list\n", dapp->name);
-  fflush(fp);
-#endif
-  gtk_combo_box_append_text (GTK_COMBO_BOX(gtkComboBox), dapp->name); 
- }
-}
-
-
-static void wmdock_refresh_properties_dialog()
-{
- gint pos = 0;
- 
- if(!prop.dlg || !prop.cbx || !prop.txtCmd) return;
-
- /* Cleanup the old list */
- while((pos = gtk_combo_box_get_active (GTK_COMBO_BOX(prop.cbx))) 
-       != -1) {
-  gtk_combo_box_remove_text(GTK_COMBO_BOX(prop.cbx), pos);
-  gtk_combo_box_set_active (GTK_COMBO_BOX(prop.cbx), 0);
- }
-
- gtk_combo_box_popdown (GTK_COMBO_BOX(prop.cbx));
- if(g_list_length(wmdock->dapps) > 0) {
-  gtk_widget_set_sensitive (prop.txtCmd, TRUE);
-
-  g_list_foreach(wmdock->dapps, (GFunc) wmdock_fill_cmbx, prop.cbx);  
-
-  
- } else {
-  gtk_combo_box_append_text (GTK_COMBO_BOX(prop.cbx), 
-			     _("No dockapp is running!"));
-
-  gtk_widget_set_state(prop.txtCmd, GTK_STATE_INSENSITIVE);
-  gtk_entry_set_text(GTK_ENTRY(prop.txtCmd), "");
-
-  gdkPbIcon = gdk_pixbuf_new_from_xpm_data((const char**) 
-					   xfce4_wmdock_plugin_xpm);
-
-  gtk_image_set_from_pixbuf (GTK_IMAGE(prop.image), gdkPbIcon);
-  
-  g_object_unref (G_OBJECT (gdkPbIcon));
- }
-
- gtk_combo_box_set_active(GTK_COMBO_BOX(prop.cbx), 0);
-
- gtk_widget_show (prop.image);
- gtk_widget_show (prop.cbx);
- gtk_widget_show (prop.txtCmd);
-}
-
-
-static void wmdock_setupdnd_dockapp(DockappNode *dapp)
-{
- /* Make the "well label" a DnD destination. */
- gtk_drag_dest_set (GTK_WIDGET(dapp->s), GTK_DEST_DEFAULT_MOTION, targetList, 
-		    nTargets, GDK_ACTION_MOVE);
- 
- gtk_drag_source_set (GTK_WIDGET(dapp->s), GDK_BUTTON1_MASK, targetList,
-		      nTargets, GDK_ACTION_MOVE);
-
- g_signal_connect (dapp->s, "drag-begin",
-		   G_CALLBACK (drag_begin_handl), dapp);
-
- g_signal_connect (dapp->s, "drag-data-get",
-		   G_CALLBACK (drag_data_get_handl), dapp);
-
-#if (GTK_MAJOR_VERSION >= 2 && GTK_MINOR_VERSION >= 12)
- g_signal_connect (dapp->s, "drag-failed",
-		   G_CALLBACK (drag_failed_handl), dapp);
-#endif
- 
- g_signal_connect (dapp->s, "drag-data-received",
-		   G_CALLBACK(drag_data_received_handl), dapp);
- g_signal_connect (dapp->s, "drag-drop",
-		   G_CALLBACK (drag_drop_handl), dapp);
-
-
-
-#ifdef DEBUG
- fprintf(fp, "Setup DnD for dockapp %s\n", dapp->name);
- fflush(fp);
-#endif
-}
-
-
-static void wmdock_destroy_dockapp(DockappNode *dapp)
-{
-#ifdef DEBUG
- fprintf(fp, "Destroy dockapp %s\n", dapp->name);
- fflush(fp);
-#endif
- XDestroyWindow(GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), dapp->i);
-}
-
-
-static void wmdock_redraw_dockapp(DockappNode *dapp)
-{
- gtk_widget_unmap (GTK_WIDGET(dapp->s));
-
- /* Tile in the background */
- if(wmdock->propDispTile == TRUE) {
-  gtk_widget_map(dapp->bg);
-  gtk_widget_set_app_paintable(GTK_WIDGET(dapp->s), TRUE);
-  gdk_window_set_back_pixmap(GTK_WIDGET(dapp->s)->window, gdkPmTile, FALSE);
-  if (GTK_WIDGET_FLAGS(GTK_WIDGET(dapp->s)) & GTK_MAPPED)
-   gtk_widget_queue_draw(GTK_WIDGET(dapp->s));
- } else {
-  gtk_widget_unmap(dapp->bg);
-  gdk_window_set_back_pixmap(GTK_WIDGET(dapp->s)->window, NULL, TRUE);
- }
-	
-#ifdef DEBUG
- fprintf(fp, "wmdock: Dockapp %s redrawed with tile %d\n", dapp->name, 
-	 wmdock->propDispTile);
- fflush(fp);
-#endif
-
- gtk_widget_map (GTK_WIDGET(dapp->s));
-	
- gtk_widget_show(GTK_WIDGET(dapp->s));
-}
-
-
-static DockappNode *wmdock_find_startup_dockapp(const gchar *compCmd)
-{
- GList *dapps;
- DockappNode *dapp = NULL;
-
- dapps = wmdock->dapps;
-
- while(dapps) {
-  dapp = (DockappNode *) dapps->data;
-  
-  if(dapp) {
-   if(!dapp->name && dapp->cmd) {
-    if(!g_ascii_strcasecmp(dapp->cmd, compCmd)) {
-#ifdef DEBUG
-     fprintf(fp, "found startup dockapp with cmd %s\n", compCmd);
-     fflush(fp);
-#endif     
-     return(dapp);
-    }
-   }
-  }
-
-  dapps = g_list_next(dapps);
- }
-
- return(NULL);
-}
-
-
-static void wmdock_dapp_closed(GtkSocket *socket, DockappNode *dapp)
-{
-#ifdef DEBUG 	
- fprintf(fp, "wmdock: closed window signal ! (window: %s)\n", dapp->name);
- fflush(fp);
-#endif
-
- wmdock->dapps = g_list_remove_all(wmdock->dapps, dapp);
-
- gtk_widget_destroy(GTK_WIDGET(dapp->tile));
- g_free(dapp->name);
- g_free(dapp->cmd);
- g_free(dapp);
-
- if(g_list_length (wmdock->dapps) == 0) {
-  wmdock_panel_draw_wmdock_icon(FALSE);
- }
-
- wmdock_refresh_properties_dialog();
-}
-
-
-static gchar *wmdock_get_dockapp_cmd(WnckWindow *w)
-{
- gchar *cmd = NULL;
- int wpid = 0;
- int argc = 0;
- int fcnt, i;
- char **argv;
- FILE *procfp = NULL;
- char buf[BUF_MAX];
-
- XGetCommand(GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), 
-	     wnck_window_get_xid(w), &argv, &argc);
- if(argc > 0) {
-  argv = (char **) realloc(argv, sizeof(char *) * (argc + 1));
-  argv[argc] = NULL;
-  cmd = g_strjoinv (" ", argv);
-  XFreeStringList(argv);
- } else {
-  /* Try to get the command line from the proc fs. */
-  wpid = wnck_window_get_pid (w);
-
-  if(wpid) {
-   sprintf(buf, "/proc/%d/cmdline", wpid);
-
-   procfp = fopen(buf, "r");
-   
-   if(procfp) {
-    fcnt = read(fileno(procfp), buf, BUF_MAX);
-
-    cmd = g_malloc(fcnt+2);
-    if(!cmd) return (NULL);
-
-    for(i = 0; i < fcnt; i++) {
-     if(buf[i] == 0)
-      *(cmd+i) = ' ';
-     else
-      *(cmd+i) = buf[i];
-    }
-    *(cmd+(i-1)) = 0;
-
-    fclose(procfp);
-   }
-  }
- }
- 
- if(!cmd) {
-  /* If nothing helps fallback to the window name. */
-  cmd = g_strdup(wnck_window_get_name(w));
- }
-
- return(cmd);
-}
-
-
-static GtkWidget *wmdock_create_tile_from_socket(DockappNode *dapp)
-{
- GtkWidget *align = NULL;
- GtkWidget *tile = NULL;
-
- tile = gtk_fixed_new();
-
- dapp->bg = gtk_image_new_from_pixmap(gdkPmTile, NULL);
- gtk_fixed_put(GTK_FIXED(tile), dapp->bg, 0, 0);
- if(wmdock->propDispTile == TRUE)
-  gtk_widget_show(dapp->bg);
-
- align = gtk_alignment_new(0.5, 0.5, 0, 0);
- gtk_widget_set_size_request(GTK_WIDGET(align), DEFAULT_DOCKAPP_WIDTH,
-			     DEFAULT_DOCKAPP_HEIGHT);
- gtk_container_add(GTK_CONTAINER(align), GTK_WIDGET(dapp->s));
- gtk_fixed_put(GTK_FIXED(tile), align, 0, 0);
-
- gtk_widget_show(align);
-
- return (tile);
-}
-
-
-static void wmdock_window_open(WnckScreen *s, WnckWindow *w) 
-{
- int wi, he;
- XWMHints *h;
- XWindowAttributes attr;
- DockappNode *dapp = NULL;
- gchar *cmd = NULL;
- gboolean rcDapp = FALSE;
-
- gdk_error_trap_push();
- gdk_flush();
-
- h = XGetWMHints(GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), 
-		 wnck_window_get_xid(w));
-
- if(!h) return;
-
- if(h->initial_state == WithdrawnState || 
-    h->flags == (WindowGroupHint | StateHint | IconWindowHint)
-    || has_dockapp_hint(w)) {
-
-#ifdef DEBUG	
-  fprintf(fp, "wmdock: new wmapp open\n");
-  fflush(fp);
-#endif
-
-
-#ifdef DEBUG
-  fprintf(fp, "wmdock: New dockapp %s with xid:%u pid:%u arrived sessid:%s\n",
-	  wnck_window_get_name(w), wnck_window_get_xid(w), 
-	  wnck_window_get_pid(w), wnck_window_get_session_id(w));
-  fflush(fp);
-#endif
-
-  cmd = wmdock_get_dockapp_cmd(w);
-
-  if(wmdock->propDispAddOnlyWM == TRUE && 
-     comp_dockapp_with_filterlist(wnck_window_get_name(w)) == FALSE && 
-     ! (wmdock_find_startup_dockapp(cmd))) {
-   XFree(h);
-   return;
-  }
-
-  if(!cmd) {
-   XFree(h);
-   return;
-  }
-
-#ifdef DEBUG
-  fprintf(fp, "wmdock: found cmd %s for window %s\n",
-	  cmd, wnck_window_get_name(w));
-  fflush(fp);
-#endif
-
-  if(rcCmds && (dapp = wmdock_find_startup_dockapp(cmd)))
-   rcDapp = TRUE;
-
-  if(rcDapp == FALSE) {
-#ifdef DEBUG
-   fprintf(fp, "wmdock: Create a new dapp window %s\n",
-	   wnck_window_get_name(w));
-   fflush(fp);
-#endif   
-   dapp = g_new0(DockappNode, 1);
-   dapp->s = GTK_SOCKET(gtk_socket_new());
-  }
-
-  if(h->initial_state == WithdrawnState && h->icon_window) {
-   XUnmapWindow(GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), 
-		wnck_window_get_xid(w));
-   dapp->i =h->icon_window;
-  } else {
-   dapp->i = wnck_window_get_xid(w);
-  }
-
-  if(!XGetWindowAttributes(GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), 
-			   dapp->i, &attr)) {
-   wi = DEFAULT_DOCKAPP_WIDTH;
-   he = DEFAULT_DOCKAPP_HEIGHT;
-  } else {
-   wi = attr.width;
-   he = attr.height;
-  }
-
-  if(wi > DEFAULT_DOCKAPP_WIDTH || he > DEFAULT_DOCKAPP_HEIGHT) {
-   /* It seems to be no dockapp, because the width or the height of the 
-    * window a greater than 64 pixels. */
-   XMapWindow(GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), 
-	      wnck_window_get_xid(w));
-   gtk_widget_destroy(GTK_WIDGET(dapp->s));
-   g_free(cmd);
-   g_free(dapp);
-   XFree(h);
-   return;
-  }
-
-#ifdef DEBUG
-  fprintf(fp, "wmdock: New dockapp %s width: %d height: %d\n",
-	  wnck_window_get_name(w), wi, he);
-  fflush(fp);
-#endif
-  
-  gtk_widget_set_size_request(GTK_WIDGET(dapp->s), wi, he);
-
-  wnck_window_set_skip_tasklist (w, TRUE);
-  wnck_window_set_skip_pager (w, TRUE);
-
-  /* Set this property to skip the XFCE4 session manager. */
-  set_xsmp_support(w);
-
-  dapp->name = g_strdup(wnck_window_get_name(w));
-  dapp->cmd = cmd;
-
-  if(wmdockIcon) {
-   gtk_widget_destroy(wmdockIcon);
-   wmdockIcon = NULL;
-  }
-
-  if(rcDapp == FALSE) {
-   XUnmapWindow(GDK_DISPLAY_XDISPLAY(gdk_display_get_default()), dapp->i);
-
-   dapp->tile = wmdock_create_tile_from_socket(dapp);
-
-   gtk_box_pack_start(GTK_BOX(wmdock->box), dapp->tile, FALSE, FALSE, 0);
-  }
-
-  gtk_socket_add_id(dapp->s, dapp->i);
-		
-  /* Tile in the background */
-  if(wmdock->propDispTile == TRUE) {
-   gtk_widget_set_app_paintable(GTK_WIDGET(dapp->s), TRUE);
-   gdk_window_set_back_pixmap(GTK_WIDGET(dapp->s)->window, gdkPmTile, FALSE);
-   if (GTK_WIDGET_FLAGS(GTK_WIDGET(dapp->s)) & GTK_MAPPED)
-    gtk_widget_queue_draw(GTK_WIDGET(dapp->s));
-  }
-
-  gtk_widget_show_all(GTK_WIDGET(dapp->tile));
-
-  g_signal_connect(dapp->s, "plug-removed", G_CALLBACK(wmdock_dapp_closed), 
-		   dapp);
-
-  if(rcDapp == FALSE)
-   wmdock->dapps=g_list_append(wmdock->dapps, dapp);
-
-  /* Test DnD */
-  g_list_foreach(wmdock->dapps, (GFunc)wmdock_setupdnd_dockapp, NULL);
-
-  wmdock_refresh_properties_dialog();
- }
-
- XFree(h);
-}
+GtkWidget    *wmdockIcon       = NULL;
+DockappNode  *dappProperties   = NULL;
+GdkPixbuf    *gdkPbTileDefault = NULL;
+GdkPixbuf    *gdkPbIcon        = NULL;
+WmdockPlugin *wmdock           = NULL;
+gchar        **rcCmds          = NULL;
+gboolean     rcPanelOff        = RCDEFAULT_PANELOFF;
 
 
 static void wmdock_orientation_changed (XfcePanelPlugin *plugin, GtkOrientation orientation, gpointer user_data)
 {
- xfce_hvbox_set_orientation ((XfceHVBox *) wmdock->panelBox, orientation);
- xfce_hvbox_set_orientation ((XfceHVBox *) wmdock->box, orientation);
- gtk_widget_show(GTK_WIDGET(wmdock->panelBox));
- gtk_widget_show(GTK_WIDGET(wmdock->box));
-}
-
-
-static gboolean wmdock_size_changed (XfcePanelPlugin *plugin, int size)
-{
- if (xfce_panel_plugin_get_orientation (plugin) ==
-     GTK_ORIENTATION_HORIZONTAL)  {
-  gtk_widget_set_size_request (GTK_WIDGET (plugin), -1, size);
- } else {
-  gtk_widget_set_size_request (GTK_WIDGET (plugin), size, -1);
- }
-	
- if(wmdockIcon) { 
-  wmdock_panel_draw_wmdock_icon(TRUE);
- }
+	xfce_hvbox_set_orientation ((XfceHVBox *) wmdock->panelBox, orientation);
+	xfce_hvbox_set_orientation ((XfceHVBox *) wmdock->box, orientation);
+	gtk_widget_show(GTK_WIDGET(wmdock->panelBox));
+	gtk_widget_show(GTK_WIDGET(wmdock->box));
 
- return TRUE;
+	if( IS_PANELOFF(wmdock) && wmdock->propPanelOffFreePositioning == FALSE )
+		wmdock_order_dockapps(wmdock_get_primary_anchor_dockapp());
 }
 
 
-static gboolean wmdock_startup_dockapp(const gchar *cmd)
+static void wmdock_resolution_changed (GdkScreen *screen, gpointer data)
 {
- gboolean ret;
- GError *err = NULL;
-
- ret = xfce_exec(cmd, FALSE, FALSE, &err);
-
- /* Errors will be evaluate in a later version. */
- if(err) g_clear_error (&err);
-	
- return(ret);
+	if( IS_PANELOFF(wmdock) && wmdock->propPanelOffFreePositioning == FALSE )
+		wmdock_order_dockapps(wmdock_get_primary_anchor_dockapp());
 }
 
 
-static void wmdock_error_dialog_response (GtkWidget  *gtkDlg, gint response)
+static void wmdock_monitors_changed (GdkScreen *screen, gpointer data)
 {
- gtk_widget_destroy (gtkDlg);
+	if( IS_PANELOFF(wmdock) && wmdock->propPanelOffFreePositioning == FALSE )
+		wmdock_order_dockapps(wmdock_get_primary_anchor_dockapp());
 }
 
 
-static void wmdock_read_rc_file (XfcePanelPlugin *plugin)
+static gboolean wmdock_size_changed (XfcePanelPlugin *plugin, int size)
 {
- gchar     *file = NULL;
- XfceRc    *rc = NULL;
- gint      i;
- GtkWidget *gtkDlg;
- DockappNode *dapp = NULL;
-	
- if (!(file = xfce_panel_plugin_lookup_rc_file (plugin))) return;
-
- rc = xfce_rc_simple_open (file, TRUE);
- g_free(file);
- 
- if(!rc) return;
-
- rcCmds = xfce_rc_read_list_entry(rc, "cmds", ";");
- rcCmdcnt = xfce_rc_read_int_entry(rc, "cmdcnt", 0);
- wmdock->propDispTile = xfce_rc_read_bool_entry (rc, "disptile", TRUE);
- wmdock->propDispPropButton = xfce_rc_read_bool_entry (rc, "disppropbtn", FALSE);
- wmdock->propDispAddOnlyWM = xfce_rc_read_bool_entry (rc, "dispaddonlywm", TRUE);
- if(wmdock->filterList) g_free(wmdock->filterList);
- wmdock->filterList = g_strdup(xfce_rc_read_entry (rc, "dafilter", DOCKAPP_FILTER_PATTERN));
-
- if(G_LIKELY(rcCmds != NULL)) {
-  for (i = 0; i <= rcCmdcnt; i++) {
-			
-#ifdef DEBUG
-   fprintf(fp, "wmdock: config will start: %s\n", rcCmds[i]);
-   fflush(fp);
-#endif
-
-   if(!rcCmds[i]) continue;
-   if(wmdock_startup_dockapp(rcCmds[i]) != TRUE) {
-    gtkDlg = gtk_message_dialog_new(GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (plugin))), 
-				    GTK_DIALOG_DESTROY_WITH_PARENT,
-				    GTK_MESSAGE_ERROR,
-				    GTK_BUTTONS_OK,
-				    _("Failed to start %s!"),
-				    rcCmds[i]);
-    g_signal_connect (gtkDlg, "response", G_CALLBACK (wmdock_error_dialog_response), NULL);						 
-    gtk_widget_show_all (gtkDlg);
-   } else {
-    /* Create some dummy widget entries to locate the right position on
-       window swallow up. */
-
-    dapp = g_new0(DockappNode, 1);
-    dapp->name = NULL;
-    dapp->cmd = rcCmds[i];
+	if (xfce_panel_plugin_get_orientation (plugin) ==
+			GTK_ORIENTATION_HORIZONTAL)  {
+		gtk_widget_set_size_request (GTK_WIDGET (plugin), -1, size);
+	} else {
+		gtk_widget_set_size_request (GTK_WIDGET (plugin), size, -1);
+	}
 
-    dapp->s = GTK_SOCKET(gtk_socket_new());
-    dapp->tile = wmdock_create_tile_from_socket(dapp);
+	if(wmdockIcon)
+		wmdock_panel_draw_wmdock_icon(TRUE);
+	if( IS_PANELOFF(wmdock) && wmdock->propPanelOffFreePositioning == FALSE )
+		wmdock_order_dockapps(wmdock_get_primary_anchor_dockapp());
 
-    gtk_box_pack_start(GTK_BOX(wmdock->box), GTK_WIDGET(dapp->tile),
-		       FALSE, FALSE, 0);
-
-    wmdock->dapps=g_list_append(wmdock->dapps, dapp);    
-   }
-			
-   /* Sleep for n microseconds to startup dockapps in the right order. */
-   /* g_usleep(250000); */
-  }
- }
- 
- xfce_rc_close (rc);
+	return TRUE;
 }
 
 
 static void wmdock_free_data(XfcePanelPlugin *plugin)
 {
-#ifdef DEBUG
- fprintf(fp, "Called wmdock_free_data\n");
- fflush(fp);
-#endif
-
- g_list_foreach(wmdock->dapps, (GFunc)wmdock_destroy_dockapp, NULL);
-
- gtk_widget_destroy(GTK_WIDGET(wmdockIcon));
- gtk_widget_destroy(GTK_WIDGET(wmdock->box));
- gtk_widget_destroy(GTK_WIDGET(wmdock->panelBox));
- gtk_widget_destroy(GTK_WIDGET(wmdock->align));
- gtk_widget_destroy(GTK_WIDGET(wmdock->eventBox));
- g_list_free(wmdock->dapps);
- g_free(wmdock);
-	
-#ifdef DEBUG
- fclose(fp);
-#endif
-}
-
-
-static void wmdock_write_rc_file (XfcePanelPlugin *plugin)
-{
- gchar       *file;
- XfceRc      *rc;
- gchar       **cmds;
- DockappNode *dapp = NULL;
- gint        i;
- 
- if (!(file = xfce_panel_plugin_save_location (plugin, TRUE))) return;
-
- rc = xfce_rc_simple_open (file, FALSE);
- g_free (file);
-
- if (!rc) return;
-
- if(g_list_length (wmdock->dapps) > 0) {
-  cmds = g_malloc(sizeof (gchar *) * (g_list_length (wmdock->dapps) + 1));
-
-  for(i = 0; i < g_list_length(wmdock->dapps); i++) {
-   dapp = g_list_nth_data(wmdock->dapps, i);
-   if(dapp) {
-    if(dapp->name && dapp->cmd)
-     cmds[i] = g_strdup(dapp->cmd);
-   }
-  }
-  /* Workaround for a xfce bug in xfce_rc_read_list_entry */
-  cmds[i] = NULL;
-
-  xfce_rc_write_list_entry(rc, "cmds", cmds, ";");
-
-  g_strfreev(cmds);
-
-  xfce_rc_write_int_entry (rc, "cmdcnt", g_list_length (wmdock->dapps));
-  xfce_rc_write_bool_entry (rc, "disptile", wmdock->propDispTile); 
-  xfce_rc_write_bool_entry (rc, "disppropbtn", wmdock->propDispPropButton); 
-  xfce_rc_write_bool_entry (rc, "dispaddonlywm", wmdock->propDispAddOnlyWM);
-  xfce_rc_write_entry(rc, "dafilter", wmdock->filterList);
- }
-
- xfce_rc_close(rc);
-
- /* Cleanup and close all dockapps! */
- /* wmdock_free_data(plugin); */
-}
-
-
-static void wmdock_properties_chkdisptile(GtkToggleButton *gtkChkDispTile, gpointer user_data)
-{
- wmdock->propDispTile = gtk_toggle_button_get_active(gtkChkDispTile);
+	debug("wmdock.c: Called wmdock_free_data");
 
- g_list_foreach(wmdock->dapps, (GFunc)wmdock_redraw_dockapp, NULL);
- gtk_widget_show_all(GTK_WIDGET(wmdock->box));
-}
-
-
-static void wmdock_properties_chkpropbtn(GtkToggleButton *gtkChkPropButton, gpointer user_data)
-{
- wmdock->propDispPropButton = gtk_toggle_button_get_active(gtkChkPropButton);
-
- if(wmdock->propDispPropButton == FALSE) {
-  if(btnProperties) gtk_widget_destroy(btnProperties);
-  btnProperties = NULL;
- }
- else
-  wmdock_panel_draw_properties_button ();
-}
-
-
-static void wmdock_properties_chkaddonlywm(GtkToggleButton *gtkChkAddOnlyWM, gpointer user_data)
-{
- wmdock->propDispAddOnlyWM = gtk_toggle_button_get_active(gtkChkAddOnlyWM);
- gtk_widget_set_sensitive (GTK_WIDGET (prop.txtPatterns),
-			   wmdock->propDispAddOnlyWM);
-}
-
-
-static gboolean wmdock_properties_refresh_dapp_icon()
-{
- GdkPixmap *pm = NULL;
- DockappNode *dapp = NULL;
- gboolean ret;
-
- if(prop.dlg && prop.image && prop.cbx) {
-  dapp = (DockappNode *) g_list_nth_data(wmdock->dapps,
-					 gtk_combo_box_get_active(GTK_COMBO_BOX(prop.cbx)));
-  if(dapp) {
-   pm = gdk_pixmap_foreign_new (dapp->i);
-   if(pm) {
-    gtk_image_set_from_pixmap (GTK_IMAGE(prop.image), pm, NULL);
-    gtk_widget_show(prop.image);
-    g_object_unref (G_OBJECT(pm));
-   }
-   else {
-    gtk_image_set_from_pixmap (GTK_IMAGE(prop.image), gdkPmTile, NULL);
-    gtk_widget_show(prop.image);
-    /* Check if the window is gone. */
-    if(!wnck_window_get (dapp->i)) {
-     ret = FALSE;
-     wmdock_dapp_closed(dapp->s, dapp);
-    }
-   }
-  }
-
-  ret = TRUE;
- } else ret = FALSE;
-
-#ifdef DEBUG
- if(ret == FALSE) {
-  fprintf(fp, "wmdock: wmdock_properties_refresh_dapp_icon status changed to FALSE\n");
-  fflush(fp);
- }
-#endif
-
- return (ret);
-}
-
-
-static void wmdock_properties_changed (GtkWidget *gtkComboBox, GtkWidget *gtkTxtCmd)
-{
- DockappNode *dapp = NULL;
+	g_list_foreach(wmdock->dapps, (GFunc)wmdock_destroy_dockapp, NULL);
 
+	/* Cleanup all the dockapps. */
+	g_list_foreach(wmdock->dapps, (GFunc)wmdock_free_dockapp, NULL);
 
- dapp = (DockappNode *) g_list_nth_data(wmdock->dapps, gtk_combo_box_get_active(GTK_COMBO_BOX(gtkComboBox)));
- if(dapp) {
-#ifdef DEBUG
-  fprintf(fp, "wmdock: changed, %s selected:\n", dapp->name);
-  fflush(fp);
-#endif
-	
-  gtk_entry_set_text(GTK_ENTRY(gtkTxtCmd), dapp->cmd);
+	gtk_widget_destroy(GTK_WIDGET(wmdockIcon));
+	gtk_widget_destroy(GTK_WIDGET(wmdock->box));
+	gtk_widget_destroy(GTK_WIDGET(wmdock->panelBox));
+	gtk_widget_destroy(GTK_WIDGET(wmdock->align));
+	gtk_widget_destroy(GTK_WIDGET(wmdock->eventBox));
+	g_list_free(wmdock->dapps);
+	g_free(wmdock);
 
-  wmdock_properties_refresh_dapp_icon();
- }
+	debug("wmdock.c: wmdock_free_data() done.");
 }
 
 
-static void wmdock_properties_moveup (GtkWidget *gtkBtnMoveUp, GtkWidget *gtkComboBox)
-{
- DockappNode *dapp = NULL;
- gint pos;
- 
- pos = gtk_combo_box_get_active(GTK_COMBO_BOX(gtkComboBox));
-
- if(g_list_length(wmdock->dapps) > 1 && pos > 0) {
-  dapp = (DockappNode *) g_list_nth_data(wmdock->dapps, pos);
-		
-  if(dapp) {
-   wmdock->dapps = g_list_remove_all(wmdock->dapps, dapp);
-   wmdock->dapps = g_list_insert(wmdock->dapps, dapp, pos - 1);
-   gtk_combo_box_remove_text(GTK_COMBO_BOX(gtkComboBox), pos);
-   gtk_combo_box_insert_text(GTK_COMBO_BOX(gtkComboBox), pos - 1, dapp->name);
-   gtk_combo_box_set_active(GTK_COMBO_BOX(gtkComboBox), pos - 1);  
-   gtk_box_reorder_child(GTK_BOX(wmdock->box), GTK_WIDGET(dapp->tile), pos - 1);
-
-   g_list_foreach(wmdock->dapps, (GFunc)wmdock_redraw_dockapp, NULL);
-  }
- }
-}
-
-
-static void wmdock_properties_movedown (GtkWidget *gtkBtnMoveDown, GtkWidget *gtkComboBox)
-{
- DockappNode *dapp = NULL;
- gint pos;
-	
- pos = gtk_combo_box_get_active(GTK_COMBO_BOX(gtkComboBox));
-	
- if(g_list_length(wmdock->dapps) > 1 && pos < g_list_length(wmdock->dapps) - 1) {
-  dapp = (DockappNode *) g_list_nth_data(wmdock->dapps, pos);
-		
-  if(dapp) {
-   wmdock->dapps = g_list_remove_all(wmdock->dapps, dapp);
-   wmdock->dapps = g_list_insert(wmdock->dapps, dapp, pos + 1);
-   gtk_combo_box_remove_text(GTK_COMBO_BOX(gtkComboBox), pos);
-   gtk_combo_box_insert_text(GTK_COMBO_BOX(gtkComboBox), pos + 1, dapp->name);
-   gtk_combo_box_set_active(GTK_COMBO_BOX(gtkComboBox), pos + 1);  
-   gtk_box_reorder_child(GTK_BOX(wmdock->box), GTK_WIDGET(dapp->tile), pos + 1);
-
-   g_list_foreach(wmdock->dapps, (GFunc)wmdock_redraw_dockapp, NULL);
-  }		
- }
-}
-
-
-static void wmdock_properties_savecmd (GtkWidget *gtkTxtCmd, GdkEventKey *event, GtkWidget *gtkComboBox)
-{
- DockappNode *dapp = NULL;
- gint pos;
-
- pos = gtk_combo_box_get_active(GTK_COMBO_BOX(gtkComboBox));
-
- dapp = (DockappNode *) g_list_nth_data(wmdock->dapps, pos);
- if(dapp) {
-  g_free(dapp->cmd);
-  dapp->cmd = g_strdup(gtk_entry_get_text(GTK_ENTRY(gtkTxtCmd)));
- }
-}
-
-
-static void wmdock_properties_dialog_response (GtkWidget  *gtkDlg, gint response)
-{
- DockappNode *dapp = NULL;
- gint pos;
-
- if(!gtkDlg) return;
-
- switch(response) {
- case GTK_RESPONSE_NO: /* Remove dockapp */
-  if(g_list_length(wmdock->dapps) > 0 && prop.cbx) {
-   pos = gtk_combo_box_get_active(GTK_COMBO_BOX(prop.cbx));
-
-   dapp = (DockappNode *) g_list_nth_data(wmdock->dapps, pos);
-   if(dapp)
-    wmdock_destroy_dockapp(dapp);
-  }
-  break;
-  
- default:
-  /* Backup the value of the dockapp filter. */
-  if(wmdock->propDispAddOnlyWM) {
-   if(wmdock->filterList) g_free(wmdock->filterList);
-   wmdock->filterList = g_strdup(gtk_entry_get_text(GTK_ENTRY(prop.txtPatterns)));
-  }
-
-  xfce_panel_plugin_unblock_menu (wmdock->plugin);
-  gtk_widget_destroy (gtkDlg);
-
-#ifdef DEBUG
-  fprintf(fp, "wmdock: properties dlg closed\n");
-  fflush(fp);
-#endif
-
-  prop.dlg = prop.cbx = prop.txtCmd = prop.image = NULL;
-  break;
- }
-}
-
-
-static void wmdock_properties_dialog_called_from_widget(GtkWidget *widget, XfcePanelPlugin *plugin)
-{
- wmdock_properties_dialog(plugin);
-}
-
-
-static void wmdock_properties_dialog(XfcePanelPlugin *plugin)
+static WmdockPlugin *wmdock_plugin_new (XfcePanelPlugin* plugin)
 {
- if(prop.dlg) return; /* Return if properties dialog is already open. */
-
- xfce_panel_plugin_block_menu (plugin);
-
- /* Create the configure dialog. */
- prop.dlg = xfce_titled_dialog_new_with_buttons (_("WMdock"),
-						 GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (plugin))),
-						 GTK_DIALOG_DESTROY_WITH_PARENT | GTK_DIALOG_NO_SEPARATOR,
-						 _("Remove dockapp"), GTK_RESPONSE_NO,
-						 GTK_STOCK_CLOSE, GTK_RESPONSE_OK,
-						 NULL);
-
- gtk_window_set_position   (GTK_WINDOW (prop.dlg), GTK_WIN_POS_CENTER);
- gtk_window_set_icon_name  (GTK_WINDOW (prop.dlg), "xfce4-settings");
-
- g_signal_connect (prop.dlg, "response", 
-		   G_CALLBACK (wmdock_properties_dialog_response),
-		   NULL);
-
- /* Create the layout containers. */
- prop.hbox = gtk_hbox_new(FALSE, 6);
- gtk_box_pack_start (GTK_BOX (GTK_DIALOG (prop.dlg)->vbox), prop.hbox, FALSE, FALSE, 0);
- gtk_container_set_border_width (GTK_CONTAINER (prop.hbox), 4);
-
- prop.frmGeneral = gtk_frame_new(_("General settings"));
- prop.frmDetect = gtk_frame_new(_("Dockapp detection"));	
- prop.vboxGeneral = gtk_vbox_new(FALSE, 6);
- prop.vboxDetect = 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_container_set_border_width (GTK_CONTAINER (prop.vboxGeneral), 4);	
- gtk_container_set_border_width (GTK_CONTAINER (prop.vboxDetect), 4);	
-
- prop.vbox = gtk_vbox_new(FALSE, 4);
- prop.vbox2 = gtk_vbox_new(FALSE, 4);
- gtk_container_set_border_width (GTK_CONTAINER (prop.vbox), 2);
- gtk_container_set_border_width (GTK_CONTAINER (prop.vbox2), 2);
- gtk_box_pack_start (GTK_BOX (prop.hbox), prop.vbox, FALSE, FALSE, 0);
- gtk_box_pack_start (GTK_BOX (prop.hbox), prop.vbox2, FALSE, FALSE, 0);
+	wmdock                              = g_new0(WmdockPlugin, 1);
+	wmdock->plugin                      = plugin;
+	wmdock->dapps                       = NULL;
+	wmdock->propDispTile                = RCDEFAULT_DISPTILE;
+	wmdock->propDispPropButton          = RCDEFAULT_DISPPROPBTN;
+	wmdock->propDispAddOnlyWM           = RCDEFAULT_DISPADDONLYWM;
+	wmdock->propPanelOff                = RCDEFAULT_PANELOFF;
+	wmdock->propPanelOffIgnoreOffset    = RCDEFAULT_PANELOFFIGNOREOFFSET;
+	wmdock->propPanelOffKeepAbove       = RCDEFAULT_PANELOFFKEEPABOVE;
+	wmdock->propPanelOffFreePositioning = RCDEFAULT_PANELOFFKEEPABOVE;
+	wmdock->panelOffFpX                 = RCDEFAULT_PANELOFFFPX;
+	wmdock->panelOffFpY                 = RCDEFAULT_PANELOFFFPY;
+	wmdock->filterList                  = g_strdup(DOCKAPP_FILTER_PATTERN);
+	wmdock->anchorPos                   = get_default_anchor_postion();
 
+	wmdock->eventBox = gtk_event_box_new ();
+	gtk_widget_show(GTK_WIDGET(wmdock->eventBox));
 
- 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);
- prop.container =  gtk_fixed_new();
+	wmdock->align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
 
- gdkPbIcon = gdk_pixbuf_new_from_xpm_data((const char**) 
-					  xfce4_wmdock_plugin_xpm);
+	gtk_widget_show(GTK_WIDGET(wmdock->align));
 
- prop.imageTile = gtk_image_new_from_pixmap(gdkPmTile, NULL);
- prop.image = gtk_image_new_from_pixbuf (gdkPbIcon);
+	gtk_container_add(GTK_CONTAINER(wmdock->eventBox), GTK_WIDGET(wmdock->align));
 
- g_object_unref (G_OBJECT (gdkPbIcon));
+	wmdock->panelBox = xfce_hvbox_new(xfce_panel_plugin_get_orientation (plugin), FALSE, 0);
+	gtk_widget_show(GTK_WIDGET(wmdock->panelBox));
 
- gtk_container_add(GTK_CONTAINER(prop.imageContainer), prop.image);
- gtk_container_add(GTK_CONTAINER(prop.container), prop.imageTile);
- gtk_container_add(GTK_CONTAINER(prop.container), prop.imageContainer);
+	wmdock->box = xfce_hvbox_new(xfce_panel_plugin_get_orientation (plugin), FALSE, 0);
 
+	gtk_box_pack_start(GTK_BOX(wmdock->panelBox), GTK_WIDGET(wmdock->box),
+			FALSE, FALSE, 0);
 
- gtk_box_pack_start (GTK_BOX(prop.vbox), GTK_WIDGET (prop.container),
-		     FALSE, FALSE, 0);
+	gtk_widget_show(GTK_WIDGET(wmdock->box));
 
- prop.btnMoveUp = xfce_arrow_button_new (GTK_ARROW_UP);
- prop.btnMoveDown = xfce_arrow_button_new (GTK_ARROW_DOWN);
- 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_container_add (GTK_CONTAINER (wmdock->align), wmdock->panelBox);
 
- prop.lblSel = gtk_label_new (_("Select dockapp to configure:"));
- gtk_misc_set_alignment (GTK_MISC (prop.lblSel), 0, 0);
- gtk_box_pack_start (GTK_BOX(prop.vbox2), prop.lblSel, FALSE, FALSE, 0);
-
- /* Create the dockapp chooser combobox */
- prop.cbx = gtk_combo_box_new_text();
-
- gtk_box_pack_start (GTK_BOX (prop.vbox2), prop.cbx, FALSE, TRUE, 0);
-
- prop.lblCmd = gtk_label_new (_("Shell command:"));
- gtk_misc_set_alignment (GTK_MISC (prop.lblCmd), 0, 0);
- gtk_box_pack_start (GTK_BOX(prop.vbox2), prop.lblCmd, FALSE, FALSE, 0);
- prop.txtCmd = gtk_entry_new();
- if(g_list_length(wmdock->dapps) > 0) {
-  gtk_editable_set_editable(GTK_EDITABLE(prop.txtCmd), TRUE);
- } else {
-  gtk_editable_set_editable(GTK_EDITABLE(prop.txtCmd), FALSE);
- }
- 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.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_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_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.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);
- 
-
- /* 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.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);
-
- if(g_list_length(wmdock->dapps) > 0)
-  wmdock_properties_changed(prop.cbx, prop.txtCmd);
-
- gtk_widget_show_all (prop.dlg);
+	return wmdock;
 }
 
 
-static WmdockPlugin *wmdock_plugin_new (XfcePanelPlugin* plugin)
+static void wmdock_construct (XfcePanelPlugin *plugin)
 {
- wmdock = g_new0(WmdockPlugin, 1);
- wmdock->plugin = plugin;
- wmdock->dapps = NULL;
- wmdock->propDispTile = TRUE;
- wmdock->propDispPropButton = FALSE;
- wmdock->propDispAddOnlyWM = TRUE;
- wmdock->filterList = g_strdup(DOCKAPP_FILTER_PATTERN);
-
- memset(&prop, 0, sizeof(prop));
-
- wmdock->eventBox = gtk_event_box_new ();
- gtk_widget_show(GTK_WIDGET(wmdock->eventBox));
-
- wmdock->align = gtk_alignment_new (0.5, 0.5, 0.0, 0.0);
+	WnckScreen  *s;
 
- gtk_widget_show(GTK_WIDGET(wmdock->align));
+	init_debug();
 
- gtk_container_add(GTK_CONTAINER(wmdock->eventBox), GTK_WIDGET(wmdock->align));
+	s = wnck_screen_get(0);
 
- wmdock->panelBox = xfce_hvbox_new(xfce_panel_plugin_get_orientation (plugin), FALSE, 0);
- gtk_widget_show(GTK_WIDGET(wmdock->panelBox));
+#ifdef HAVE_CONFIG_H
+	xfce_textdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
+#endif /* HAVE_CONFIG_H */
 
- wmdock->box = xfce_hvbox_new(xfce_panel_plugin_get_orientation (plugin), FALSE, 0);
+	XfceDockAppAtom=XInternAtom(GDK_DISPLAY_XDISPLAY(get_current_gdkdisplay()),
+			"_XFCE4_DOCKAPP",False);
 
- gtk_box_pack_start(GTK_BOX(wmdock->panelBox), GTK_WIDGET(wmdock->box), 
-		    FALSE, FALSE, 0);
+	wmdock = wmdock_plugin_new (plugin);
 
- gtk_widget_show(GTK_WIDGET(wmdock->box));
-
- gtk_container_add (GTK_CONTAINER (wmdock->align), wmdock->panelBox);
- 
- return wmdock;
-}
+	if(wmdock_get_instance_count() > 1) {
+		wmdock_msg_dialog(
+				GTK_MESSAGE_ERROR,
+#ifdef HAVE_CONFIG_H
+				_("Only a single instance of `%s' can run."),
+				GETTEXT_PACKAGE);
+#else
+				_("Only a single instance of `xfce4-wmdock-plugin' can run."));
+#endif /* HAVE_CONFIG_H */
 
+		xfce_panel_plugin_remove(plugin);
+	}
 
-static void wmdock_construct (XfcePanelPlugin *plugin)
-{
- WnckScreen  *s;
+	g_signal_connect(s, "window_opened", G_CALLBACK(wmdock_window_open), NULL);
+	g_signal_connect (plugin, "size-changed", G_CALLBACK (wmdock_size_changed), NULL);
+	g_signal_connect (plugin, "orientation-changed", G_CALLBACK (wmdock_orientation_changed), NULL);
+	g_signal_connect (plugin, "free-data", G_CALLBACK (wmdock_free_data), NULL);
+	g_signal_connect(get_current_gdkscreen(), "size-changed", G_CALLBACK(wmdock_resolution_changed), NULL);
+	g_signal_connect(get_current_gdkscreen(), "monitors-changed", G_CALLBACK(wmdock_monitors_changed), NULL);
 
-#ifdef DEBUG
- char debugFile[BUF_MAX];
- sprintf(debugFile, "%s/wmdock-debug.%d", g_get_tmp_dir(), getpid());
- fp = fopen(debugFile, "w");
- if(!fp) fp = stderr;
-#endif
+	gtk_container_add (GTK_CONTAINER (plugin), wmdock->eventBox);
 
- s = wnck_screen_get(0);
+	xfce_panel_plugin_add_action_widget (plugin, wmdock->eventBox);
 
- xfce_textdomain(GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR, "UTF-8");
+	/* Setup the tile image */
+	gdkPbTileDefault = gdk_pixbuf_new_from_xpm_data((const char **) tile_xpm);
 
- XfceDockAppAtom=XInternAtom(GDK_DISPLAY_XDISPLAY(gdk_display_get_default()),
-			     "_XFCE4_DOCKAPP",False);
-	
- wmdock = wmdock_plugin_new (plugin);
-	 
- g_signal_connect(s, "window_opened", G_CALLBACK(wmdock_window_open), NULL);
- g_signal_connect (plugin, "size-changed", G_CALLBACK (wmdock_size_changed), NULL);
- g_signal_connect (plugin, "orientation-changed", G_CALLBACK (wmdock_orientation_changed), NULL);
- g_signal_connect (plugin, "free-data", G_CALLBACK (wmdock_free_data), NULL);
+	wmdock_panel_draw_wmdock_icon(FALSE);
 
- gtk_container_add (GTK_CONTAINER (plugin), wmdock->eventBox);
-	
- xfce_panel_plugin_add_action_widget (plugin, wmdock->eventBox);
+	/* Configure plugin dialog */
+	xfce_panel_plugin_menu_show_configure (plugin);
+	g_signal_connect (plugin, "configure-plugin",
+			G_CALLBACK (wmdock_properties_dialog), NULL);
 
- /* Setup the tile image */    	                                  	
- gdkPmTile = gdk_pixmap_create_from_xpm_d (wmdock->eventBox->window, NULL,
-					   NULL, tile_xpm);
+	/* Read the config file and start the dockapps */
+	wmdock_read_rc_file(plugin);
 
- wmdock_panel_draw_wmdock_icon(FALSE);
-	
- /* Configure plugin dialog */
- xfce_panel_plugin_menu_show_configure (plugin);
- g_signal_connect (plugin, "configure-plugin",
-		   G_CALLBACK (wmdock_properties_dialog), NULL);
-	
- /* Read the config file and start the dockapps */
- wmdock_read_rc_file(plugin);
+	wmdock_panel_draw_properties_button();
 
- wmdock_panel_draw_properties_button();
-	
- g_signal_connect (plugin, "save", G_CALLBACK (wmdock_write_rc_file), NULL);
+	g_signal_connect (plugin, "save", G_CALLBACK (wmdock_write_rc_file), NULL);
 }
 
 XFCE_PANEL_PLUGIN_REGISTER_EXTERNAL (wmdock_construct);
diff --git a/panel-plugin/wmdock.h b/panel-plugin/wmdock.h
index f8c42c9..0475a9e 100644
--- a/panel-plugin/wmdock.h
+++ b/panel-plugin/wmdock.h
@@ -1,9 +1,7 @@
 /* wmdock xfce4 plugin by Andre Ellguth
  *
- * $Id$
- *
  * Authors:
- *   Andre Ellguth <ellguth at ibh.de>
+ *   Andre Ellguth <andre at ellguth.com>
  *
  * License:
  *   This program is free software; you can redistribute it and/or modify
@@ -30,31 +28,44 @@
 #define WNCK_I_KNOW_THIS_IS_UNSTABLE
 #include <libwnck/libwnck.h>
 
-typedef struct _dockapp {
- GtkSocket       *s;
- GdkNativeWindow i;
- GtkWidget       *bg;
- GtkWidget       *tile;
- gchar           *name;
- gchar           *cmd;
-} DockappNode;
+typedef enum {
+	ANCHOR_TL,
+	ANCHOR_TR,
+	ANCHOR_BL,
+	ANCHOR_BR
+} AnchorPostion;
 
 typedef struct {
- XfcePanelPlugin *plugin;
+ XfcePanelPlugin     *plugin;
 
- GtkWidget       *eventBox;
+ GtkWidget           *eventBox;
 	
  /* Plugin specific definitions */
- GtkWidget       *align;
- GtkWidget       *box;
- GtkWidget       *panelBox;
+ GtkWidget           *align;
+ GtkWidget           *box;
+ GtkWidget           *panelBox;
 	
- gboolean        propDispTile;
- gboolean        propDispPropButton;
- gboolean        propDispAddOnlyWM;
- gchar           *filterList;
+ gboolean            propDispTile;
+ gboolean            propDispPropButton;
+ gboolean            propDispAddOnlyWM;
+ gboolean            propPanelOff;
+ gboolean            propPanelOffIgnoreOffset;
+ gboolean            propPanelOffKeepAbove;
+ gboolean            propPanelOffFreePositioning;
+ gint                panelOffFpX;
+ gint                panelOffFpY;
+ AnchorPostion       anchorPos;
+ gchar               *filterList;
 
- GList           *dapps;
+ GList               *dapps;
 } WmdockPlugin;
 
+#define BUF_MAX 4096
+#define DEFAULT_DOCKAPP_WIDTH  64
+#define DEFAULT_DOCKAPP_HEIGHT 64
+/* Default filter for dockapps. All dockapps starting with "wm" or "as". */
+#define DOCKAPP_FILTER_PATTERN "^wm;^as"
+
+#define IS_PANELOFF(__wmdock) (__wmdock->propPanelOff == TRUE)
+
 #endif /* __WMDOCK_H__ */
diff --git a/po/ChangeLog b/po/ChangeLog
new file mode 100644
index 0000000..e4f7abc
--- /dev/null
+++ b/po/ChangeLog
@@ -0,0 +1,54 @@
+2013-10-20  gettextize  <bug-gnu-gettext at gnu.org>
+
+	* Makefile.in.in: Upgrade to gettext-0.18.1.
+	* Rules-quot: New file, from gettext-0.18.1.
+	* boldquot.sed: New file, from gettext-0.18.1.
+	* en at boldquot.header: New file, from gettext-0.18.1.
+	* en at quot.header: New file, from gettext-0.18.1.
+	* insert-header.sin: New file, from gettext-0.18.1.
+	* quot.sed: New file, from gettext-0.18.1.
+	* remove-potcdate.sin: New file, from gettext-0.18.1.
+
+2009-08-08  Mike Massonnet <mmassonnet at xfce.org>
+
+	* ast.po: Asturian translation added (Marcos Alvarez Costales)
+	* gl.po: Galician translation update (Leandro Regueiro)
+	* id.po: Indonesian translation added (Andhika Padmawan).
+
+2009-06-28  Mike Massonnet <mmassonnet at xfce.org>
+
+	* zh_CN.po: Simplified Chinese translation update (Hunt Xu)
+
+2009-06-09  Michal Várady <miko.vaji at gmail.com>
+
+	* cs.po: Czech translation added
+
+2009-05-29  Mike Massonnet <mmassonnet at xfce.org>
+
+	* ca.po: Catalan translation update (Harald Servat)
+	* ur_PK.po: Urdu Pakistan translation update (Muhammad Ali Makki)
+	* ur.po: Urdu translation update (Muhammad Ali Makki)
+
+2009-04-20  Mike Massonnet <mmassonnet at xfce.org>
+
+	* gl.po: Galician translation added (Leandro Regueiro)
+
+2009-02-19 Per Kongstad <pko at xfce.org>
+
+	* da.po, LINGUAS: Danish translation added (Per Kongstad)
+
+2009-01-13  Alexander Toresson <eulex at xfce.org>
+
+	* sv.po, LINGUAS: Swedish translation added (Daniel Nylander)
+
+2008-12-13  Maximilian Schleiss <maximilian at xfce.org>
+
+	* zh_CN.po: Simplified Chinese translation added (Hunt Xu)
+
+2008-08-24 Og Maciel <ogmaciel at gnome.org>
+
+	* pt_BR.po: Added Brazilian Portuguese translation by Fábio Nogueira.
+	* LINGUAS: Added.
+	* ChangeLog: Added.
+
+
diff --git a/po/POTFILES.in b/po/POTFILES.in
index d439c6f..48d3423 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -1 +1,18 @@
 panel-plugin/wmdock.c
+panel-plugin/wmdock.h
+panel-plugin/catchwindow.c
+panel-plugin/catchwindow.h
+panel-plugin/debug.c
+panel-plugin/debug.h
+panel-plugin/dnd.c
+panel-plugin/dnd.h
+panel-plugin/dockapp.c
+panel-plugin/dockapp.h
+panel-plugin/extern.h
+panel-plugin/misc.c
+panel-plugin/misc.h
+panel-plugin/props.c
+panel-plugin/props.h
+panel-plugin/rcfile.c
+panel-plugin/rcfile.h
+panel-plugin/wmdock.c
diff --git a/po/ast.po b/po/ast.po
index 6d849eb..5871b2a 100644
--- a/po/ast.po
+++ b/po/ast.po
@@ -7,68 +7,136 @@ msgid ""
 msgstr ""
 "Project-Id-Version: xfce4-wmdock-plugin 0.2.0\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-01-26 20:22+0100\n"
+"POT-Creation-Date: 2013-10-20 22:08+0200\n"
 "PO-Revision-Date: 2009-07-13 20:01+0100\n"
 "Last-Translator: Marcos Antonio Alvarez Costales <marcoscostales at gmail.com>\n"
 "Language-Team: Asturian Team <alministradores at softastur.org>\n"
+"Language: \n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=utf-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: panel-plugin/wmdock.c:196
+#: ../panel-plugin/wmdock.c:190
+#, c-format
+msgid "Only a single instance of `%s' can run."
+msgstr ""
+
+#: ../panel-plugin/wmdock.c:193
+msgid "Only a single instance of `xfce4-wmdock-plugin' can run."
+msgstr ""
+
+#: ../panel-plugin/dnd.c:73
 #, c-format
 msgid "Do you want remove the dockapp \"%s\"?"
 msgstr "¿Quieres desaniciar el dock \"%s\"?"
 
-#: panel-plugin/wmdock.c:398
+#: ../panel-plugin/props.c:93
+msgid "Changes maybe not work properly until you restart XFCE!"
+msgstr ""
+
+#: ../panel-plugin/props.c:170
+msgid "Changes will take effect when you restart XFCE!"
+msgstr ""
+
+#: ../panel-plugin/props.c:386
 msgid "No dockapp is running!"
 msgstr "¡El dock nun ta executándose!"
 
-#: panel-plugin/wmdock.c:858
-#, c-format
-msgid "Failed to start %s!"
-msgstr "¡Falló al aniciar %s!"
-
-#: panel-plugin/wmdock.c:1148
+#. Create the configure dialog.
+#: ../panel-plugin/props.c:415
 msgid "WMdock"
 msgstr "WMdock"
 
-#: panel-plugin/wmdock.c:1151
+#: ../panel-plugin/props.c:418
 msgid "Remove dockapp"
 msgstr "Desaniciar dock"
 
-#: panel-plugin/wmdock.c:1167
+#: ../panel-plugin/props.c:434
 msgid "General settings"
 msgstr "Axustes Xenerales"
 
-#: panel-plugin/wmdock.c:1168
+#: ../panel-plugin/props.c:435
 msgid "Dockapp detection"
 msgstr "Deteición Dock"
 
-#: panel-plugin/wmdock.c:1216
+#: ../panel-plugin/props.c:436
+#, fuzzy
+msgid "Mode settings"
+msgstr "Axustes Xenerales"
+
+#: ../panel-plugin/props.c:483
 msgid "Select dockapp to configure:"
 msgstr "Seleicionar dock pa configurar:"
 
-#: panel-plugin/wmdock.c:1225
+#: ../panel-plugin/props.c:492
 msgid "Shell command:"
 msgstr "Comandu Shell:"
 
-#: panel-plugin/wmdock.c:1236
+#: ../panel-plugin/props.c:503
 msgid "Display tile in the background."
 msgstr "Amosar en mosaicu nel fondu."
 
-#: panel-plugin/wmdock.c:1237
-msgid ""
-"Display a separate WMdock properties\n"
-"button in the panel."
+#: ../panel-plugin/props.c:504
+#, fuzzy
+msgid "Display a separate WMdock properties button in the panel."
 msgstr ""
 "Amosar propiedaes de WMdock separtaes\n"
 "nún botón nel panel."
 
-#: panel-plugin/wmdock.c:1238
-msgid ""
-"Add only dockapps which start with\n"
-"wm* in the name."
+#: ../panel-plugin/props.c:505
+#, fuzzy
+msgid "Add only dockapps which start with pattern in list. (e.g.: ^wm;^as)"
 msgstr ""
 "Amestar namái dock cuando anicie con\n"
 "wm* nel nome."
+
+#: ../panel-plugin/props.c:506
+#, fuzzy
+msgid "Display dockapps in separate windows and not in the panel."
+msgstr ""
+"Amosar propiedaes de WMdock separtaes\n"
+"nún botón nel panel."
+
+#: ../panel-plugin/props.c:507
+msgid "Don't use panel size as offset for the first dockapp."
+msgstr ""
+
+#: ../panel-plugin/props.c:508
+msgid "Keep dockapp windows on top."
+msgstr ""
+
+#: ../panel-plugin/props.c:509
+msgid "Enable free positioning of the first dockapp on the screen."
+msgstr ""
+
+#: ../panel-plugin/props.c:538
+msgid ""
+"Hint: Is the first dockapp covered by a XFCE panel, please try to move the "
+"plugin\n"
+"to this panel to correct this problem."
+msgstr ""
+
+#: ../panel-plugin/props.c:542
+msgid "Placement:"
+msgstr ""
+
+#: ../panel-plugin/props.c:544
+msgid "Top left"
+msgstr ""
+
+#: ../panel-plugin/props.c:545
+msgid "Top right"
+msgstr ""
+
+#: ../panel-plugin/props.c:546
+msgid "Bottom left"
+msgstr ""
+
+#: ../panel-plugin/props.c:547
+msgid "Bottom right"
+msgstr ""
+
+#: ../panel-plugin/rcfile.c:93
+#, fuzzy, c-format
+msgid "Failed to start `%s'!"
+msgstr "¡Falló al aniciar %s!"
diff --git a/po/ca.po b/po/ca.po
index 39967ee..cb81dd9 100644
--- a/po/ca.po
+++ b/po/ca.po
@@ -7,70 +7,138 @@ msgid ""
 msgstr ""
 "Project-Id-Version: xfce4-wmdock-plugin\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-01-26 20:22+0100\n"
+"POT-Creation-Date: 2013-10-20 22:08+0200\n"
 "PO-Revision-Date: \n"
 "Last-Translator: Harald Servat <redcrash at gmail.com>\n"
 "Language-Team: Harald Servat <redcrash at gmail.com>\n"
+"Language: \n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "X-Poedit-Language: Català\n"
 "X-Poedit-Country: Spain\n"
 
-#: panel-plugin/wmdock.c:196
+#: ../panel-plugin/wmdock.c:190
+#, c-format
+msgid "Only a single instance of `%s' can run."
+msgstr ""
+
+#: ../panel-plugin/wmdock.c:193
+msgid "Only a single instance of `xfce4-wmdock-plugin' can run."
+msgstr ""
+
+#: ../panel-plugin/dnd.c:73
 #, c-format
 msgid "Do you want remove the dockapp \"%s\"?"
 msgstr "Voleu eliminar l'aplicació amarrada \"%s\"?"
 
-#: panel-plugin/wmdock.c:398
+#: ../panel-plugin/props.c:93
+msgid "Changes maybe not work properly until you restart XFCE!"
+msgstr ""
+
+#: ../panel-plugin/props.c:170
+msgid "Changes will take effect when you restart XFCE!"
+msgstr ""
+
+#: ../panel-plugin/props.c:386
 msgid "No dockapp is running!"
 msgstr "No hi ha aplicacions amarrades!"
 
-#: panel-plugin/wmdock.c:858
-#, c-format
-msgid "Failed to start %s!"
-msgstr "No s'ha pogut iniciar %s!"
-
-#: panel-plugin/wmdock.c:1148
+#. Create the configure dialog.
+#: ../panel-plugin/props.c:415
 msgid "WMdock"
 msgstr "WMdock"
 
-#: panel-plugin/wmdock.c:1151
+#: ../panel-plugin/props.c:418
 msgid "Remove dockapp"
 msgstr "Eliminar l'aplicació amarrada"
 
-#: panel-plugin/wmdock.c:1167
+#: ../panel-plugin/props.c:434
 msgid "General settings"
 msgstr "Configuració general"
 
-#: panel-plugin/wmdock.c:1168
+#: ../panel-plugin/props.c:435
 msgid "Dockapp detection"
 msgstr "Detecció d'aplicacions "
 
-#: panel-plugin/wmdock.c:1216
+#: ../panel-plugin/props.c:436
+#, fuzzy
+msgid "Mode settings"
+msgstr "Configuració general"
+
+#: ../panel-plugin/props.c:483
 msgid "Select dockapp to configure:"
 msgstr "Trieu l'aplicació amarrada per a configurar:"
 
-#: panel-plugin/wmdock.c:1225
+#: ../panel-plugin/props.c:492
 msgid "Shell command:"
 msgstr "Comandes per a l'interpretes de comandes:"
 
-#: panel-plugin/wmdock.c:1236
+#: ../panel-plugin/props.c:503
 msgid "Display tile in the background."
 msgstr "Mostrar un mosaic al fons."
 
-#: panel-plugin/wmdock.c:1237
-msgid ""
-"Display a separate WMdock properties\n"
-"button in the panel."
+#: ../panel-plugin/props.c:504
+#, fuzzy
+msgid "Display a separate WMdock properties button in the panel."
 msgstr ""
 "Mostrar un botó separat per a les\n"
 "propietats de WMdock al panell."
 
-#: panel-plugin/wmdock.c:1238
-msgid ""
-"Add only dockapps which start with\n"
-"wm* in the name."
+#: ../panel-plugin/props.c:505
+#, fuzzy
+msgid "Add only dockapps which start with pattern in list. (e.g.: ^wm;^as)"
 msgstr ""
 "Només afegir aplicacions amarrades que\n"
 "al nom comencin amb wm*."
+
+#: ../panel-plugin/props.c:506
+#, fuzzy
+msgid "Display dockapps in separate windows and not in the panel."
+msgstr ""
+"Mostrar un botó separat per a les\n"
+"propietats de WMdock al panell."
+
+#: ../panel-plugin/props.c:507
+msgid "Don't use panel size as offset for the first dockapp."
+msgstr ""
+
+#: ../panel-plugin/props.c:508
+msgid "Keep dockapp windows on top."
+msgstr ""
+
+#: ../panel-plugin/props.c:509
+msgid "Enable free positioning of the first dockapp on the screen."
+msgstr ""
+
+#: ../panel-plugin/props.c:538
+msgid ""
+"Hint: Is the first dockapp covered by a XFCE panel, please try to move the "
+"plugin\n"
+"to this panel to correct this problem."
+msgstr ""
+
+#: ../panel-plugin/props.c:542
+msgid "Placement:"
+msgstr ""
+
+#: ../panel-plugin/props.c:544
+msgid "Top left"
+msgstr ""
+
+#: ../panel-plugin/props.c:545
+msgid "Top right"
+msgstr ""
+
+#: ../panel-plugin/props.c:546
+msgid "Bottom left"
+msgstr ""
+
+#: ../panel-plugin/props.c:547
+msgid "Bottom right"
+msgstr ""
+
+#: ../panel-plugin/rcfile.c:93
+#, fuzzy, c-format
+msgid "Failed to start `%s'!"
+msgstr "No s'ha pogut iniciar %s!"
diff --git a/po/da.po b/po/da.po
index 503c5cf..2a8668a 100644
--- a/po/da.po
+++ b/po/da.po
@@ -7,10 +7,11 @@ msgid ""
 msgstr ""
 "Project-Id-Version: xfce4-wmdock-plugin 0.3.2\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-01-26 20:22+0100\n"
+"POT-Creation-Date: 2013-10-20 22:08+0200\n"
 "PO-Revision-Date: 2009-02-18 13:43+0100\n"
 "Last-Translator: Per Kongstad <p_kongstad at op.pl>\n"
 "Language-Team: Danish <dansk-dansk-gruppen.dk>\n"
+"Language: da\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=utf-8\n"
 "Content-Transfer-Encoding: 8bit\n"
@@ -18,61 +19,127 @@ msgstr ""
 "X-Poedit-Country: DENMARK\n"
 "X-Poedit-SourceCharset: utf-8\n"
 
-#: panel-plugin/wmdock.c:196
+#: ../panel-plugin/wmdock.c:190
+#, c-format
+msgid "Only a single instance of `%s' can run."
+msgstr ""
+
+#: ../panel-plugin/wmdock.c:193
+msgid "Only a single instance of `xfce4-wmdock-plugin' can run."
+msgstr ""
+
+#: ../panel-plugin/dnd.c:73
 #, c-format
 msgid "Do you want remove the dockapp \"%s\"?"
 msgstr "Vil du fjerne dokprogrammet \"%s\"?"
 
-#: panel-plugin/wmdock.c:398
+#: ../panel-plugin/props.c:93
+msgid "Changes maybe not work properly until you restart XFCE!"
+msgstr ""
+
+#: ../panel-plugin/props.c:170
+msgid "Changes will take effect when you restart XFCE!"
+msgstr ""
+
+#: ../panel-plugin/props.c:386
 msgid "No dockapp is running!"
 msgstr "Intet dokprogram kører!"
 
-#: panel-plugin/wmdock.c:858
-#, c-format
-msgid "Failed to start %s!"
-msgstr "Kunne ikke starte %s!"
-
-#: panel-plugin/wmdock.c:1148
+#. Create the configure dialog.
+#: ../panel-plugin/props.c:415
 msgid "WMdock"
 msgstr "WMdock"
 
-#: panel-plugin/wmdock.c:1151
+#: ../panel-plugin/props.c:418
 msgid "Remove dockapp"
 msgstr "Fjern dokprogram"
 
-#: panel-plugin/wmdock.c:1167
+#: ../panel-plugin/props.c:434
 msgid "General settings"
 msgstr "Generelle indstillinger"
 
-#: panel-plugin/wmdock.c:1168
+#: ../panel-plugin/props.c:435
 msgid "Dockapp detection"
 msgstr "Dokprogramgenkeldelse"
 
-#: panel-plugin/wmdock.c:1216
+#: ../panel-plugin/props.c:436
+#, fuzzy
+msgid "Mode settings"
+msgstr "Generelle indstillinger"
+
+#: ../panel-plugin/props.c:483
 msgid "Select dockapp to configure:"
 msgstr "Vælg dokprogram til at indstille:"
 
-#: panel-plugin/wmdock.c:1225
+#: ../panel-plugin/props.c:492
 msgid "Shell command:"
 msgstr "Skalkommando:"
 
-#: panel-plugin/wmdock.c:1236
+#: ../panel-plugin/props.c:503
 msgid "Display tile in the background."
 msgstr "Vis flise i baggrunden."
 
-#: panel-plugin/wmdock.c:1237
-msgid ""
-"Display a separate WMdock properties\n"
-"button in the panel."
+#: ../panel-plugin/props.c:504
+#, fuzzy
+msgid "Display a separate WMdock properties button in the panel."
 msgstr ""
 "Vis en separat WMdock-egenskabsknap\n"
 "i panelet."
 
-#: panel-plugin/wmdock.c:1238
-msgid ""
-"Add only dockapps which start with\n"
-"wm* in the name."
+#: ../panel-plugin/props.c:505
+#, fuzzy
+msgid "Add only dockapps which start with pattern in list. (e.g.: ^wm;^as)"
 msgstr ""
 "Tilføj kun dokprogrammer som starter med\n"
 "vm* i navnet."
 
+#: ../panel-plugin/props.c:506
+#, fuzzy
+msgid "Display dockapps in separate windows and not in the panel."
+msgstr ""
+"Vis en separat WMdock-egenskabsknap\n"
+"i panelet."
+
+#: ../panel-plugin/props.c:507
+msgid "Don't use panel size as offset for the first dockapp."
+msgstr ""
+
+#: ../panel-plugin/props.c:508
+msgid "Keep dockapp windows on top."
+msgstr ""
+
+#: ../panel-plugin/props.c:509
+msgid "Enable free positioning of the first dockapp on the screen."
+msgstr ""
+
+#: ../panel-plugin/props.c:538
+msgid ""
+"Hint: Is the first dockapp covered by a XFCE panel, please try to move the "
+"plugin\n"
+"to this panel to correct this problem."
+msgstr ""
+
+#: ../panel-plugin/props.c:542
+msgid "Placement:"
+msgstr ""
+
+#: ../panel-plugin/props.c:544
+msgid "Top left"
+msgstr ""
+
+#: ../panel-plugin/props.c:545
+msgid "Top right"
+msgstr ""
+
+#: ../panel-plugin/props.c:546
+msgid "Bottom left"
+msgstr ""
+
+#: ../panel-plugin/props.c:547
+msgid "Bottom right"
+msgstr ""
+
+#: ../panel-plugin/rcfile.c:93
+#, fuzzy, c-format
+msgid "Failed to start `%s'!"
+msgstr "Kunne ikke starte %s!"
diff --git a/po/de.po b/po/de.po
index e568c96..72f1659 100644
--- a/po/de.po
+++ b/po/de.po
@@ -9,7 +9,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: xfce4-wmdock-plugin master\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-01-26 20:22+0100\n"
+"POT-Creation-Date: 2013-10-20 22:08+0200\n"
 "PO-Revision-Date: 2012-03-28 22:28+0100\n"
 "Last-Translator: Mario Blättermann <mario.blaettermann at gmail.com>\n"
 "Language-Team: German Xfce Translation Team <xfce-i18n-de at xfce.org>\n"
@@ -21,63 +21,130 @@ msgstr ""
 "X-Poedit-Language: German\n"
 "X-Poedit-Country: GERMANY\n"
 
-#: panel-plugin/wmdock.c:196
+#: ../panel-plugin/wmdock.c:190
+#, c-format
+msgid "Only a single instance of `%s' can run."
+msgstr ""
+
+#: ../panel-plugin/wmdock.c:193
+msgid "Only a single instance of `xfce4-wmdock-plugin' can run."
+msgstr ""
+
+#: ../panel-plugin/dnd.c:73
 #, c-format
 msgid "Do you want remove the dockapp \"%s\"?"
 msgstr "Soll das Dockapp »%s« entfernt werden?"
 
-#: panel-plugin/wmdock.c:398
+#: ../panel-plugin/props.c:93
+msgid "Changes maybe not work properly until you restart XFCE!"
+msgstr ""
+
+#: ../panel-plugin/props.c:170
+msgid "Changes will take effect when you restart XFCE!"
+msgstr ""
+
+#: ../panel-plugin/props.c:386
 msgid "No dockapp is running!"
 msgstr "Kein Dockapp gestartet!"
 
-#: panel-plugin/wmdock.c:858
-#, c-format
-msgid "Failed to start %s!"
-msgstr "Fehler beim Starten von %s!"
-
-#: panel-plugin/wmdock.c:1148
+#. Create the configure dialog.
+#: ../panel-plugin/props.c:415
 msgid "WMdock"
 msgstr "Windowmaker-Dock"
 
-#: panel-plugin/wmdock.c:1151
+#: ../panel-plugin/props.c:418
 msgid "Remove dockapp"
 msgstr "Dockapp entfernen"
 
-#: panel-plugin/wmdock.c:1167
+#: ../panel-plugin/props.c:434
 msgid "General settings"
 msgstr "Allgemeine Einstellungen"
 
-#: panel-plugin/wmdock.c:1168
+#: ../panel-plugin/props.c:435
 msgid "Dockapp detection"
 msgstr "Dockapp-Erkennung"
 
-#: panel-plugin/wmdock.c:1216
+#: ../panel-plugin/props.c:436
+#, fuzzy
+msgid "Mode settings"
+msgstr "Allgemeine Einstellungen"
+
+#: ../panel-plugin/props.c:483
 msgid "Select dockapp to configure:"
 msgstr "Wählen Sie ein Dockapp aus:"
 
-#: panel-plugin/wmdock.c:1225
+#: ../panel-plugin/props.c:492
 msgid "Shell command:"
 msgstr "Shell-Befehl:"
 
-#: panel-plugin/wmdock.c:1236
+#: ../panel-plugin/props.c:503
 msgid "Display tile in the background."
 msgstr "Kachel im Hintergrund anzeigen."
 
-#: panel-plugin/wmdock.c:1237
-msgid ""
-"Display a separate WMdock properties\n"
-"button in the panel."
+#: ../panel-plugin/props.c:504
+#, fuzzy
+msgid "Display a separate WMdock properties button in the panel."
 msgstr ""
 "Zusätzlichen Konfigurationsknopf\n"
 "in der Leiste anzeigen"
 
-#: panel-plugin/wmdock.c:1238
-msgid ""
-"Add only dockapps which start with\n"
-"wm* in the name."
+#: ../panel-plugin/props.c:505
+#, fuzzy
+msgid "Add only dockapps which start with pattern in list. (e.g.: ^wm;^as)"
 msgstr ""
 "Nur Dockapps hinzufügen, deren\n"
 "Name *wm enthält."
 
+#: ../panel-plugin/props.c:506
+#, fuzzy
+msgid "Display dockapps in separate windows and not in the panel."
+msgstr ""
+"Zusätzlichen Konfigurationsknopf\n"
+"in der Leiste anzeigen"
+
+#: ../panel-plugin/props.c:507
+msgid "Don't use panel size as offset for the first dockapp."
+msgstr ""
+
+#: ../panel-plugin/props.c:508
+msgid "Keep dockapp windows on top."
+msgstr ""
+
+#: ../panel-plugin/props.c:509
+msgid "Enable free positioning of the first dockapp on the screen."
+msgstr ""
+
+#: ../panel-plugin/props.c:538
+msgid ""
+"Hint: Is the first dockapp covered by a XFCE panel, please try to move the "
+"plugin\n"
+"to this panel to correct this problem."
+msgstr ""
+
+#: ../panel-plugin/props.c:542
+msgid "Placement:"
+msgstr ""
+
+#: ../panel-plugin/props.c:544
+msgid "Top left"
+msgstr ""
+
+#: ../panel-plugin/props.c:545
+msgid "Top right"
+msgstr ""
+
+#: ../panel-plugin/props.c:546
+msgid "Bottom left"
+msgstr ""
+
+#: ../panel-plugin/props.c:547
+msgid "Bottom right"
+msgstr ""
+
+#: ../panel-plugin/rcfile.c:93
+#, fuzzy, c-format
+msgid "Failed to start `%s'!"
+msgstr "Fehler beim Starten von %s!"
+
 #~ msgid "General settings:"
 #~ msgstr "Allgemeine Einstellungen:"
diff --git a/po/el.po b/po/el.po
index 5c4209b..61eb1ae 100644
--- a/po/el.po
+++ b/po/el.po
@@ -1,12 +1,13 @@
-# 
+#
 msgid ""
 msgstr ""
 "Project-Id-Version: xfce4-wmdock-plugin\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-01-26 20:22+0100\n"
+"POT-Creation-Date: 2013-10-20 22:08+0200\n"
 "PO-Revision-Date: \n"
 "Last-Translator: George Vasilakos <forfolias at linuxteam.cs.teilar.gr>\n"
 "Language-Team: Greek <nls at tux.hellug.gr>\n"
+"Language: el\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
@@ -14,60 +15,127 @@ msgstr ""
 "X-Poedit-Language: Greek\n"
 "X-Poedit-Country: GREECE\n"
 
-#: panel-plugin/wmdock.c:196
+#: ../panel-plugin/wmdock.c:190
+#, c-format
+msgid "Only a single instance of `%s' can run."
+msgstr ""
+
+#: ../panel-plugin/wmdock.c:193
+msgid "Only a single instance of `xfce4-wmdock-plugin' can run."
+msgstr ""
+
+#: ../panel-plugin/dnd.c:73
 #, c-format
 msgid "Do you want remove the dockapp \"%s\"?"
 msgstr "Θέλετε αφαιρέσετε το την προσάρτηση \"%s\";"
 
-#: panel-plugin/wmdock.c:398
+#: ../panel-plugin/props.c:93
+msgid "Changes maybe not work properly until you restart XFCE!"
+msgstr ""
+
+#: ../panel-plugin/props.c:170
+msgid "Changes will take effect when you restart XFCE!"
+msgstr ""
+
+#: ../panel-plugin/props.c:386
 msgid "No dockapp is running!"
 msgstr "Δεν τρέχει κάποια προσάρτηση!"
 
-#: panel-plugin/wmdock.c:858
-#, c-format
-msgid "Failed to start %s!"
-msgstr "Αποτυχία εκκίνησης του %s!"
-
-#: panel-plugin/wmdock.c:1148
+#. Create the configure dialog.
+#: ../panel-plugin/props.c:415
 msgid "WMdock"
 msgstr "WMdock"
 
-#: panel-plugin/wmdock.c:1151
+#: ../panel-plugin/props.c:418
 msgid "Remove dockapp"
 msgstr "Αφαίρεση προσάρτησης"
 
-#: panel-plugin/wmdock.c:1167
+#: ../panel-plugin/props.c:434
 msgid "General settings"
 msgstr "Γενικές ρυθμίσεις"
 
-#: panel-plugin/wmdock.c:1168
+#: ../panel-plugin/props.c:435
 msgid "Dockapp detection"
 msgstr "Ανίχνευση προσαρτήσεων"
 
-#: panel-plugin/wmdock.c:1216
+#: ../panel-plugin/props.c:436
+#, fuzzy
+msgid "Mode settings"
+msgstr "Γενικές ρυθμίσεις"
+
+#: ../panel-plugin/props.c:483
 msgid "Select dockapp to configure:"
 msgstr "Επιλέξτε "
 
-#: panel-plugin/wmdock.c:1225
+#: ../panel-plugin/props.c:492
 msgid "Shell command:"
 msgstr "Εντολή κελύφους:"
 
-#: panel-plugin/wmdock.c:1236
+#: ../panel-plugin/props.c:503
 msgid "Display tile in the background."
 msgstr "Εμφάνιση στο παρασκήνιο."
 
-#: panel-plugin/wmdock.c:1237
-msgid ""
-"Display a separate WMdock properties\n"
-"button in the panel."
+#: ../panel-plugin/props.c:504
+#, fuzzy
+msgid "Display a separate WMdock properties button in the panel."
 msgstr ""
 "Εμφάνιση ξεχωριστού κουμπιού ιδιοτήτων\n"
 "του WMdock στο ταμπλό."
 
-#: panel-plugin/wmdock.c:1238
-msgid ""
-"Add only dockapps which start with\n"
-"wm* in the name."
+#: ../panel-plugin/props.c:505
+#, fuzzy
+msgid "Add only dockapps which start with pattern in list. (e.g.: ^wm;^as)"
 msgstr ""
 "Προσθήκη μόνο προσαρτήσεων που αρχίζουν με \n"
 "wm* στο όνομα."
+
+#: ../panel-plugin/props.c:506
+#, fuzzy
+msgid "Display dockapps in separate windows and not in the panel."
+msgstr ""
+"Εμφάνιση ξεχωριστού κουμπιού ιδιοτήτων\n"
+"του WMdock στο ταμπλό."
+
+#: ../panel-plugin/props.c:507
+msgid "Don't use panel size as offset for the first dockapp."
+msgstr ""
+
+#: ../panel-plugin/props.c:508
+msgid "Keep dockapp windows on top."
+msgstr ""
+
+#: ../panel-plugin/props.c:509
+msgid "Enable free positioning of the first dockapp on the screen."
+msgstr ""
+
+#: ../panel-plugin/props.c:538
+msgid ""
+"Hint: Is the first dockapp covered by a XFCE panel, please try to move the "
+"plugin\n"
+"to this panel to correct this problem."
+msgstr ""
+
+#: ../panel-plugin/props.c:542
+msgid "Placement:"
+msgstr ""
+
+#: ../panel-plugin/props.c:544
+msgid "Top left"
+msgstr ""
+
+#: ../panel-plugin/props.c:545
+msgid "Top right"
+msgstr ""
+
+#: ../panel-plugin/props.c:546
+msgid "Bottom left"
+msgstr ""
+
+#: ../panel-plugin/props.c:547
+msgid "Bottom right"
+msgstr ""
+
+#: ../panel-plugin/rcfile.c:93
+#, fuzzy, c-format
+msgid "Failed to start `%s'!"
+msgstr "Αποτυχία εκκίνησης του %s!"
diff --git a/po/en_GB.po b/po/en_GB.po
index d8390de..a6a77d2 100644
--- a/po/en_GB.po
+++ b/po/en_GB.po
@@ -2,73 +2,141 @@
 # Copyright (C) 2008 Andre Ellguth
 # This file is distributed under the same license as the PACKAGE package.
 # Andre Ellguth <ellguth at ibh.de>, 2008.
-# 
+#
 msgid ""
 msgstr ""
 "Project-Id-Version: xfce4-wmdock-plugin 0.2.0\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-01-26 20:22+0100\n"
+"POT-Creation-Date: 2013-10-20 22:08+0200\n"
 "PO-Revision-Date: 2008-08-17 18:05+0200\n"
 "Last-Translator: Andre Ellguth <ellguth at ibh.de>\n"
 "Language-Team: none <LL at li.org>\n"
+"Language: \n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=utf-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: panel-plugin/wmdock.c:196
+#: ../panel-plugin/wmdock.c:190
+#, c-format
+msgid "Only a single instance of `%s' can run."
+msgstr ""
+
+#: ../panel-plugin/wmdock.c:193
+msgid "Only a single instance of `xfce4-wmdock-plugin' can run."
+msgstr ""
+
+#: ../panel-plugin/dnd.c:73
 #, c-format
 msgid "Do you want remove the dockapp \"%s\"?"
 msgstr "Do you want remove the dockapp \"%s\"?"
 
-#: panel-plugin/wmdock.c:398
+#: ../panel-plugin/props.c:93
+msgid "Changes maybe not work properly until you restart XFCE!"
+msgstr ""
+
+#: ../panel-plugin/props.c:170
+msgid "Changes will take effect when you restart XFCE!"
+msgstr ""
+
+#: ../panel-plugin/props.c:386
 msgid "No dockapp is running!"
 msgstr "No dockapp is running!"
 
-#: panel-plugin/wmdock.c:858
-#, c-format
-msgid "Failed to start %s!"
-msgstr "Failed to start %s!"
-
-#: panel-plugin/wmdock.c:1148
+#. Create the configure dialog.
+#: ../panel-plugin/props.c:415
 msgid "WMdock"
 msgstr "WMdock"
 
-#: panel-plugin/wmdock.c:1151
+#: ../panel-plugin/props.c:418
 msgid "Remove dockapp"
 msgstr "Remove dockapp"
 
-#: panel-plugin/wmdock.c:1167
+#: ../panel-plugin/props.c:434
 msgid "General settings"
 msgstr "General settings"
 
-#: panel-plugin/wmdock.c:1168
+#: ../panel-plugin/props.c:435
 msgid "Dockapp detection"
 msgstr "Dockapp detection"
 
-#: panel-plugin/wmdock.c:1216
+#: ../panel-plugin/props.c:436
+#, fuzzy
+msgid "Mode settings"
+msgstr "General settings"
+
+#: ../panel-plugin/props.c:483
 msgid "Select dockapp to configure:"
 msgstr "Select dockapp to configure:"
 
-#: panel-plugin/wmdock.c:1225
+#: ../panel-plugin/props.c:492
 msgid "Shell command:"
 msgstr "Shell command:"
 
-#: panel-plugin/wmdock.c:1236
+#: ../panel-plugin/props.c:503
 msgid "Display tile in the background."
 msgstr "Display tile in the background."
 
-#: panel-plugin/wmdock.c:1237
-msgid ""
+#: ../panel-plugin/props.c:504
+#, fuzzy
+msgid "Display a separate WMdock properties button in the panel."
+msgstr ""
 "Display a separate WMdock properties\n"
 "button in the panel."
+
+#: ../panel-plugin/props.c:505
+#, fuzzy
+msgid "Add only dockapps which start with pattern in list. (e.g.: ^wm;^as)"
+msgstr ""
+"Add only dockapps which start with\n"
+"wm* in the name."
+
+#: ../panel-plugin/props.c:506
+#, fuzzy
+msgid "Display dockapps in separate windows and not in the panel."
 msgstr ""
 "Display a separate WMdock properties\n"
 "button in the panel."
 
-#: panel-plugin/wmdock.c:1238
+#: ../panel-plugin/props.c:507
+msgid "Don't use panel size as offset for the first dockapp."
+msgstr ""
+
+#: ../panel-plugin/props.c:508
+msgid "Keep dockapp windows on top."
+msgstr ""
+
+#: ../panel-plugin/props.c:509
+msgid "Enable free positioning of the first dockapp on the screen."
+msgstr ""
+
+#: ../panel-plugin/props.c:538
 msgid ""
-"Add only dockapps which start with\n"
-"wm* in the name."
+"Hint: Is the first dockapp covered by a XFCE panel, please try to move the "
+"plugin\n"
+"to this panel to correct this problem."
 msgstr ""
-"Add only dockapps which start with\n"
-"wm* in the name."
+
+#: ../panel-plugin/props.c:542
+msgid "Placement:"
+msgstr ""
+
+#: ../panel-plugin/props.c:544
+msgid "Top left"
+msgstr ""
+
+#: ../panel-plugin/props.c:545
+msgid "Top right"
+msgstr ""
+
+#: ../panel-plugin/props.c:546
+msgid "Bottom left"
+msgstr ""
+
+#: ../panel-plugin/props.c:547
+msgid "Bottom right"
+msgstr ""
+
+#: ../panel-plugin/rcfile.c:93
+#, fuzzy, c-format
+msgid "Failed to start `%s'!"
+msgstr "Failed to start %s!"
diff --git a/po/eu.po b/po/eu.po
index 938c865..f56325a 100644
--- a/po/eu.po
+++ b/po/eu.po
@@ -6,71 +6,138 @@ msgid ""
 msgstr ""
 "Project-Id-Version: \n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-01-26 20:22+0100\n"
+"POT-Creation-Date: 2013-10-20 22:08+0200\n"
 "PO-Revision-Date: 2010-02-09 10:06+0100\n"
 "Last-Translator: \n"
 "Language-Team: Basque <kde-i18n-doc at kde.org>\n"
+"Language: eu\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "X-Generator: Lokalize 1.0\n"
 "Plural-Forms: nplurals=2; plural=n != 1;\n"
 
-#: panel-plugin/wmdock.c:196
+#: ../panel-plugin/wmdock.c:190
+#, c-format
+msgid "Only a single instance of `%s' can run."
+msgstr ""
+
+#: ../panel-plugin/wmdock.c:193
+msgid "Only a single instance of `xfce4-wmdock-plugin' can run."
+msgstr ""
+
+#: ../panel-plugin/dnd.c:73
 #, c-format
 msgid "Do you want remove the dockapp \"%s\"?"
 msgstr "\"%s\" dockapp-a ezabatu nahi al duzu?"
 
-#: panel-plugin/wmdock.c:398
+#: ../panel-plugin/props.c:93
+msgid "Changes maybe not work properly until you restart XFCE!"
+msgstr ""
+
+#: ../panel-plugin/props.c:170
+msgid "Changes will take effect when you restart XFCE!"
+msgstr ""
+
+#: ../panel-plugin/props.c:386
 msgid "No dockapp is running!"
 msgstr "Ez dago dockapp-ik martxan!"
 
-#: panel-plugin/wmdock.c:858
-#, c-format
-msgid "Failed to start %s!"
-msgstr "Huts %s abiaraztean!"
-
-#: panel-plugin/wmdock.c:1148
+#. Create the configure dialog.
+#: ../panel-plugin/props.c:415
 msgid "WMdock"
 msgstr "WMdock"
 
-#: panel-plugin/wmdock.c:1151
+#: ../panel-plugin/props.c:418
 msgid "Remove dockapp"
 msgstr "Kendu dockapp-a"
 
-#: panel-plugin/wmdock.c:1167
+#: ../panel-plugin/props.c:434
 msgid "General settings"
 msgstr "Ezarpen orokorrak"
 
-#: panel-plugin/wmdock.c:1168
+#: ../panel-plugin/props.c:435
 msgid "Dockapp detection"
 msgstr "dockapp detekzioa"
 
-#: panel-plugin/wmdock.c:1216
+#: ../panel-plugin/props.c:436
+#, fuzzy
+msgid "Mode settings"
+msgstr "Ezarpen orokorrak"
+
+#: ../panel-plugin/props.c:483
 msgid "Select dockapp to configure:"
 msgstr "Hautatu konfiguratu behar den dockapp-a:"
 
-#: panel-plugin/wmdock.c:1225
+#: ../panel-plugin/props.c:492
 msgid "Shell command:"
 msgstr "Shell komandoa:"
 
-#: panel-plugin/wmdock.c:1236
+#: ../panel-plugin/props.c:503
 msgid "Display tile in the background."
 msgstr "Ikusi mosaikoa atzeko planoan."
 
-#: panel-plugin/wmdock.c:1237
-msgid ""
-"Display a separate WMdock properties\n"
-"button in the panel."
+#: ../panel-plugin/props.c:504
+#, fuzzy
+msgid "Display a separate WMdock properties button in the panel."
 msgstr ""
 "Bistarazi WMdock propietate botoi berezi\n"
 "bat panelean."
 
-#: panel-plugin/wmdock.c:1238
-msgid ""
-"Add only dockapps which start with\n"
-"wm* in the name."
+#: ../panel-plugin/props.c:505
+#, fuzzy
+msgid "Add only dockapps which start with pattern in list. (e.g.: ^wm;^as)"
 msgstr ""
 "GEhi bakarrik izen hasiera wm* duten\n"
 "dockapp-ak."
 
+#: ../panel-plugin/props.c:506
+#, fuzzy
+msgid "Display dockapps in separate windows and not in the panel."
+msgstr ""
+"Bistarazi WMdock propietate botoi berezi\n"
+"bat panelean."
+
+#: ../panel-plugin/props.c:507
+msgid "Don't use panel size as offset for the first dockapp."
+msgstr ""
+
+#: ../panel-plugin/props.c:508
+msgid "Keep dockapp windows on top."
+msgstr ""
+
+#: ../panel-plugin/props.c:509
+msgid "Enable free positioning of the first dockapp on the screen."
+msgstr ""
+
+#: ../panel-plugin/props.c:538
+msgid ""
+"Hint: Is the first dockapp covered by a XFCE panel, please try to move the "
+"plugin\n"
+"to this panel to correct this problem."
+msgstr ""
+
+#: ../panel-plugin/props.c:542
+msgid "Placement:"
+msgstr ""
+
+#: ../panel-plugin/props.c:544
+msgid "Top left"
+msgstr ""
+
+#: ../panel-plugin/props.c:545
+msgid "Top right"
+msgstr ""
+
+#: ../panel-plugin/props.c:546
+msgid "Bottom left"
+msgstr ""
+
+#: ../panel-plugin/props.c:547
+msgid "Bottom right"
+msgstr ""
+
+#: ../panel-plugin/rcfile.c:93
+#, fuzzy, c-format
+msgid "Failed to start `%s'!"
+msgstr "Huts %s abiaraztean!"
diff --git a/po/gl.po b/po/gl.po
index a02c7de..e9fc9a0 100644
--- a/po/gl.po
+++ b/po/gl.po
@@ -1,79 +1,147 @@
 # Galician translation of xfce4-wmdock-plugin
 # Copyright (C) 2008-2009 Leandro Regueiro
 # This file is distributed under the same license as the xfce package.
-# 
+#
 # Leandro Regueiro <leandro.regueiro at gmail.com>, 2009.
-# 
+#
 # Proxecto Trasno - Adaptación do software libre á lingua galega:  Se desexas
 # colaborar connosco, podes atopar máis información en <http://trasno.net>
-# 
+#
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-01-26 20:22+0100\n"
+"POT-Creation-Date: 2013-10-20 22:08+0200\n"
 "PO-Revision-Date: 2009-08-19 16:08+0100\n"
 "Last-Translator: Leandro Regueiro <leandro.regueiro at gmail.com>\n"
 "Language-Team: Galician <proxecto at trasno.net>\n"
+"Language: gl\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 "Plural-Forms: nplurals=2; plural=(n!=1);\n"
 
-#: panel-plugin/wmdock.c:196
+#: ../panel-plugin/wmdock.c:190
+#, c-format
+msgid "Only a single instance of `%s' can run."
+msgstr ""
+
+#: ../panel-plugin/wmdock.c:193
+msgid "Only a single instance of `xfce4-wmdock-plugin' can run."
+msgstr ""
+
+#: ../panel-plugin/dnd.c:73
 #, c-format
 msgid "Do you want remove the dockapp \"%s\"?"
 msgstr "Desexa eliminar o ancorábel \"%s\"?"
 
-#: panel-plugin/wmdock.c:398
+#: ../panel-plugin/props.c:93
+msgid "Changes maybe not work properly until you restart XFCE!"
+msgstr ""
+
+#: ../panel-plugin/props.c:170
+msgid "Changes will take effect when you restart XFCE!"
+msgstr ""
+
+#: ../panel-plugin/props.c:386
 msgid "No dockapp is running!"
 msgstr "Non se está executando ningún ancorábel!"
 
-#: panel-plugin/wmdock.c:858
-#, c-format
-msgid "Failed to start %s!"
-msgstr "Fallo ao iniciar %s!"
-
-#: panel-plugin/wmdock.c:1148
+#. Create the configure dialog.
+#: ../panel-plugin/props.c:415
 msgid "WMdock"
 msgstr "WMdock"
 
-#: panel-plugin/wmdock.c:1151
+#: ../panel-plugin/props.c:418
 msgid "Remove dockapp"
 msgstr "Eliminar o ancorábel"
 
-#: panel-plugin/wmdock.c:1167
+#: ../panel-plugin/props.c:434
 msgid "General settings"
 msgstr "Configuración xeral"
 
-#: panel-plugin/wmdock.c:1168
+#: ../panel-plugin/props.c:435
 msgid "Dockapp detection"
 msgstr "Detección de ancorábeis"
 
-#: panel-plugin/wmdock.c:1216
+#: ../panel-plugin/props.c:436
+#, fuzzy
+msgid "Mode settings"
+msgstr "Configuración xeral"
+
+#: ../panel-plugin/props.c:483
 msgid "Select dockapp to configure:"
 msgstr "Seleccione o ancorábel a configurar:"
 
-#: panel-plugin/wmdock.c:1225
+#: ../panel-plugin/props.c:492
 msgid "Shell command:"
 msgstr "Orde de shell:"
 
-#: panel-plugin/wmdock.c:1236
+#: ../panel-plugin/props.c:503
 msgid "Display tile in the background."
 msgstr "Mostrar mosaico no fondo."
 
-#: panel-plugin/wmdock.c:1237
-msgid ""
-"Display a separate WMdock properties\n"
-"button in the panel."
+#: ../panel-plugin/props.c:504
+#, fuzzy
+msgid "Display a separate WMdock properties button in the panel."
 msgstr ""
 "Mostra un botón aparte para as\n"
 "propiedades de WMdock no panel."
 
-#: panel-plugin/wmdock.c:1238
-msgid ""
-"Add only dockapps which start with\n"
-"wm* in the name."
+#: ../panel-plugin/props.c:505
+#, fuzzy
+msgid "Add only dockapps which start with pattern in list. (e.g.: ^wm;^as)"
 msgstr ""
 "Engadir só ancorábeis cuxo nome\n"
 "comece por wm*."
+
+#: ../panel-plugin/props.c:506
+#, fuzzy
+msgid "Display dockapps in separate windows and not in the panel."
+msgstr ""
+"Mostra un botón aparte para as\n"
+"propiedades de WMdock no panel."
+
+#: ../panel-plugin/props.c:507
+msgid "Don't use panel size as offset for the first dockapp."
+msgstr ""
+
+#: ../panel-plugin/props.c:508
+msgid "Keep dockapp windows on top."
+msgstr ""
+
+#: ../panel-plugin/props.c:509
+msgid "Enable free positioning of the first dockapp on the screen."
+msgstr ""
+
+#: ../panel-plugin/props.c:538
+msgid ""
+"Hint: Is the first dockapp covered by a XFCE panel, please try to move the "
+"plugin\n"
+"to this panel to correct this problem."
+msgstr ""
+
+#: ../panel-plugin/props.c:542
+msgid "Placement:"
+msgstr ""
+
+#: ../panel-plugin/props.c:544
+msgid "Top left"
+msgstr ""
+
+#: ../panel-plugin/props.c:545
+msgid "Top right"
+msgstr ""
+
+#: ../panel-plugin/props.c:546
+msgid "Bottom left"
+msgstr ""
+
+#: ../panel-plugin/props.c:547
+msgid "Bottom right"
+msgstr ""
+
+#: ../panel-plugin/rcfile.c:93
+#, fuzzy, c-format
+msgid "Failed to start `%s'!"
+msgstr "Fallo ao iniciar %s!"
diff --git a/po/ja.po b/po/ja.po
index 022ba01..a0789b6 100644
--- a/po/ja.po
+++ b/po/ja.po
@@ -7,7 +7,7 @@ msgid ""
 msgstr ""
 "Project-Id-Version: xfce4-wmdock-plugin 0.3.2\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-01-26 20:22+0100\n"
+"POT-Creation-Date: 2013-10-20 22:08+0200\n"
 "PO-Revision-Date: 2010-08-25 03:01+0900\n"
 "Last-Translator: Nobuhiro Iwamatsu <iwamatsu at nigauri.org>\n"
 "Language-Team: Japanese <xfce-users-jp at ml.fdiary.net>\n"
@@ -16,61 +16,127 @@ msgstr ""
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: panel-plugin/wmdock.c:196
+#: ../panel-plugin/wmdock.c:190
+#, c-format
+msgid "Only a single instance of `%s' can run."
+msgstr ""
+
+#: ../panel-plugin/wmdock.c:193
+msgid "Only a single instance of `xfce4-wmdock-plugin' can run."
+msgstr ""
+
+#: ../panel-plugin/dnd.c:73
 #, c-format
 msgid "Do you want remove the dockapp \"%s\"?"
 msgstr "Dockapp \"%s\" を削除しますか?"
 
-#: panel-plugin/wmdock.c:398
+#: ../panel-plugin/props.c:93
+msgid "Changes maybe not work properly until you restart XFCE!"
+msgstr ""
+
+#: ../panel-plugin/props.c:170
+msgid "Changes will take effect when you restart XFCE!"
+msgstr ""
+
+#: ../panel-plugin/props.c:386
 msgid "No dockapp is running!"
 msgstr "Dockapp は実行されていません!"
 
-#: panel-plugin/wmdock.c:858
-#, c-format
-msgid "Failed to start %s!"
-msgstr "%s の開始に失敗しました!"
-
-#: panel-plugin/wmdock.c:1148
+#. Create the configure dialog.
+#: ../panel-plugin/props.c:415
 msgid "WMdock"
 msgstr "WMdock"
 
-#: panel-plugin/wmdock.c:1151
+#: ../panel-plugin/props.c:418
 msgid "Remove dockapp"
 msgstr "Dockapp を削除"
 
-#: panel-plugin/wmdock.c:1167
+#: ../panel-plugin/props.c:434
 msgid "General settings"
 msgstr "基本設定"
 
-#: panel-plugin/wmdock.c:1168
+#: ../panel-plugin/props.c:435
 msgid "Dockapp detection"
 msgstr "Dockapp 検出"
 
-#: panel-plugin/wmdock.c:1216
+#: ../panel-plugin/props.c:436
+#, fuzzy
+msgid "Mode settings"
+msgstr "基本設定"
+
+#: ../panel-plugin/props.c:483
 msgid "Select dockapp to configure:"
 msgstr "設定する dockapp を選択:"
 
-#: panel-plugin/wmdock.c:1225
+#: ../panel-plugin/props.c:492
 msgid "Shell command:"
 msgstr "シェルコマンド:"
 
-#: panel-plugin/wmdock.c:1236
+#: ../panel-plugin/props.c:503
 msgid "Display tile in the background."
 msgstr "背景にタイル状に表示"
 
-#: panel-plugin/wmdock.c:1237
-msgid ""
-"Display a separate WMdock properties\n"
-"button in the panel."
+#: ../panel-plugin/props.c:504
+#, fuzzy
+msgid "Display a separate WMdock properties button in the panel."
 msgstr ""
 "パネルに別々の WMdock プロパティボタンを\n"
 "表示する。"
 
-#: panel-plugin/wmdock.c:1238
-msgid ""
-"Add only dockapps which start with\n"
-"wm* in the name."
+#: ../panel-plugin/props.c:505
+#, fuzzy
+msgid "Add only dockapps which start with pattern in list. (e.g.: ^wm;^as)"
 msgstr ""
 "wm*から始まる名前の dockapps だけ\n"
 "を追加する。"
 
+#: ../panel-plugin/props.c:506
+#, fuzzy
+msgid "Display dockapps in separate windows and not in the panel."
+msgstr ""
+"パネルに別々の WMdock プロパティボタンを\n"
+"表示する。"
+
+#: ../panel-plugin/props.c:507
+msgid "Don't use panel size as offset for the first dockapp."
+msgstr ""
+
+#: ../panel-plugin/props.c:508
+msgid "Keep dockapp windows on top."
+msgstr ""
+
+#: ../panel-plugin/props.c:509
+msgid "Enable free positioning of the first dockapp on the screen."
+msgstr ""
+
+#: ../panel-plugin/props.c:538
+msgid ""
+"Hint: Is the first dockapp covered by a XFCE panel, please try to move the "
+"plugin\n"
+"to this panel to correct this problem."
+msgstr ""
+
+#: ../panel-plugin/props.c:542
+msgid "Placement:"
+msgstr ""
+
+#: ../panel-plugin/props.c:544
+msgid "Top left"
+msgstr ""
+
+#: ../panel-plugin/props.c:545
+msgid "Top right"
+msgstr ""
+
+#: ../panel-plugin/props.c:546
+msgid "Bottom left"
+msgstr ""
+
+#: ../panel-plugin/props.c:547
+msgid "Bottom right"
+msgstr ""
+
+#: ../panel-plugin/rcfile.c:93
+#, fuzzy, c-format
+msgid "Failed to start `%s'!"
+msgstr "%s の開始に失敗しました!"
diff --git a/po/lv.po b/po/lv.po
index 716cff1..69ebeee 100644
--- a/po/lv.po
+++ b/po/lv.po
@@ -6,10 +6,11 @@ msgid ""
 msgstr ""
 "Project-Id-Version: \n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-01-26 20:22+0100\n"
+"POT-Creation-Date: 2013-10-20 22:08+0200\n"
 "PO-Revision-Date: 2009-09-18 23:48+0100\n"
 "Last-Translator: Rihards Prieditis <rprieditis at gmail.com>\n"
 "Language-Team: Latvian <translation-team-lv at lists.sourceforge.net>\n"
+"Language: lv\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=UTF-8\n"
 "Content-Transfer-Encoding: 8bit\n"
@@ -17,61 +18,127 @@ msgstr ""
 "Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n != 0 ? 1 : "
 "2);\n"
 
-#: panel-plugin/wmdock.c:196
+#: ../panel-plugin/wmdock.c:190
+#, c-format
+msgid "Only a single instance of `%s' can run."
+msgstr ""
+
+#: ../panel-plugin/wmdock.c:193
+msgid "Only a single instance of `xfce4-wmdock-plugin' can run."
+msgstr ""
+
+#: ../panel-plugin/dnd.c:73
 #, c-format
 msgid "Do you want remove the dockapp \"%s\"?"
 msgstr "Vai vēlaties noņemt enkura lietotni \"%s\"?"
 
-#: panel-plugin/wmdock.c:398
+#: ../panel-plugin/props.c:93
+msgid "Changes maybe not work properly until you restart XFCE!"
+msgstr ""
+
+#: ../panel-plugin/props.c:170
+msgid "Changes will take effect when you restart XFCE!"
+msgstr ""
+
+#: ../panel-plugin/props.c:386
 msgid "No dockapp is running!"
 msgstr "dockapp neskrien!"
 
-#: panel-plugin/wmdock.c:858
-#, c-format
-msgid "Failed to start %s!"
-msgstr "Neizdevās palaist %s!"
-
-#: panel-plugin/wmdock.c:1148
+#. Create the configure dialog.
+#: ../panel-plugin/props.c:415
 msgid "WMdock"
 msgstr "WMdock"
 
-#: panel-plugin/wmdock.c:1151
+#: ../panel-plugin/props.c:418
 msgid "Remove dockapp"
 msgstr "Noņemt doka lietotni"
 
-#: panel-plugin/wmdock.c:1167
+#: ../panel-plugin/props.c:434
 msgid "General settings"
 msgstr "Vispārējie uzstādījumi"
 
-#: panel-plugin/wmdock.c:1168
+#: ../panel-plugin/props.c:435
 msgid "Dockapp detection"
 msgstr "Doka lietotne atrasta"
 
-#: panel-plugin/wmdock.c:1216
+#: ../panel-plugin/props.c:436
+#, fuzzy
+msgid "Mode settings"
+msgstr "Vispārējie uzstādījumi"
+
+#: ../panel-plugin/props.c:483
 msgid "Select dockapp to configure:"
 msgstr "Atlasiet konfigurējamo doka lietotni:"
 
-#: panel-plugin/wmdock.c:1225
+#: ../panel-plugin/props.c:492
 msgid "Shell command:"
 msgstr "Čaulas komanda:"
 
-#: panel-plugin/wmdock.c:1236
+#: ../panel-plugin/props.c:503
 msgid "Display tile in the background."
 msgstr "Attēlot virsrakstu fonā."
 
-#: panel-plugin/wmdock.c:1237
-msgid ""
-"Display a separate WMdock properties\n"
-"button in the panel."
+#: ../panel-plugin/props.c:504
+#, fuzzy
+msgid "Display a separate WMdock properties button in the panel."
 msgstr ""
 "Attēlo atdalīti WMdock rekvizītu\n"
 "pogu uz paneļa."
 
-#: panel-plugin/wmdock.c:1238
-msgid ""
-"Add only dockapps which start with\n"
-"wm* in the name."
+#: ../panel-plugin/props.c:505
+#, fuzzy
+msgid "Add only dockapps which start with pattern in list. (e.g.: ^wm;^as)"
 msgstr ""
 "Pievienot doka lietotni, kura sākas ar\n"
 "wm* nosaukumā."
 
+#: ../panel-plugin/props.c:506
+#, fuzzy
+msgid "Display dockapps in separate windows and not in the panel."
+msgstr ""
+"Attēlo atdalīti WMdock rekvizītu\n"
+"pogu uz paneļa."
+
+#: ../panel-plugin/props.c:507
+msgid "Don't use panel size as offset for the first dockapp."
+msgstr ""
+
+#: ../panel-plugin/props.c:508
+msgid "Keep dockapp windows on top."
+msgstr ""
+
+#: ../panel-plugin/props.c:509
+msgid "Enable free positioning of the first dockapp on the screen."
+msgstr ""
+
+#: ../panel-plugin/props.c:538
+msgid ""
+"Hint: Is the first dockapp covered by a XFCE panel, please try to move the "
+"plugin\n"
+"to this panel to correct this problem."
+msgstr ""
+
+#: ../panel-plugin/props.c:542
+msgid "Placement:"
+msgstr ""
+
+#: ../panel-plugin/props.c:544
+msgid "Top left"
+msgstr ""
+
+#: ../panel-plugin/props.c:545
+msgid "Top right"
+msgstr ""
+
+#: ../panel-plugin/props.c:546
+msgid "Bottom left"
+msgstr ""
+
+#: ../panel-plugin/props.c:547
+msgid "Bottom right"
+msgstr ""
+
+#: ../panel-plugin/rcfile.c:93
+#, fuzzy, c-format
+msgid "Failed to start `%s'!"
+msgstr "Neizdevās palaist %s!"
diff --git a/po/sv.po b/po/sv.po
index 5d911e7..f907c79 100644
--- a/po/sv.po
+++ b/po/sv.po
@@ -7,69 +7,136 @@ msgid ""
 msgstr ""
 "Project-Id-Version: xfce4-wmdock-plugin\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-01-26 20:22+0100\n"
+"POT-Creation-Date: 2013-10-20 22:08+0200\n"
 "PO-Revision-Date: 2009-12-16 18:01+0100\n"
 "Last-Translator: Daniel Nylander <po at danielnylander.se>\n"
 "Language-Team: Swedish <tp-sv at listor.tp-sv.se>\n"
+"Language: sv\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=utf-8\n"
 "Content-Transfer-Encoding: 8bit\n"
 
-#: panel-plugin/wmdock.c:196
+#: ../panel-plugin/wmdock.c:190
+#, c-format
+msgid "Only a single instance of `%s' can run."
+msgstr ""
+
+#: ../panel-plugin/wmdock.c:193
+msgid "Only a single instance of `xfce4-wmdock-plugin' can run."
+msgstr ""
+
+#: ../panel-plugin/dnd.c:73
 #, c-format
 msgid "Do you want remove the dockapp \"%s\"?"
 msgstr "Vill du ta bort dockprogrammet \"%s\"?"
 
-#: panel-plugin/wmdock.c:398
+#: ../panel-plugin/props.c:93
+msgid "Changes maybe not work properly until you restart XFCE!"
+msgstr ""
+
+#: ../panel-plugin/props.c:170
+msgid "Changes will take effect when you restart XFCE!"
+msgstr ""
+
+#: ../panel-plugin/props.c:386
 msgid "No dockapp is running!"
 msgstr "Inget dockprogram körs!"
 
-#: panel-plugin/wmdock.c:858
-#, c-format
-msgid "Failed to start %s!"
-msgstr "Misslyckades med att starta %s!"
-
-#: panel-plugin/wmdock.c:1148
+#. Create the configure dialog.
+#: ../panel-plugin/props.c:415
 msgid "WMdock"
 msgstr "WMdock"
 
-#: panel-plugin/wmdock.c:1151
+#: ../panel-plugin/props.c:418
 msgid "Remove dockapp"
 msgstr "Ta bort dockprogram"
 
-#: panel-plugin/wmdock.c:1167
+#: ../panel-plugin/props.c:434
 msgid "General settings"
 msgstr "Allmänna inställningar"
 
-#: panel-plugin/wmdock.c:1168
+#: ../panel-plugin/props.c:435
 msgid "Dockapp detection"
 msgstr "Identifiera dockprogram"
 
-#: panel-plugin/wmdock.c:1216
+#: ../panel-plugin/props.c:436
+#, fuzzy
+msgid "Mode settings"
+msgstr "Allmänna inställningar"
+
+#: ../panel-plugin/props.c:483
 msgid "Select dockapp to configure:"
 msgstr "Välj dockprogram att konfigurera:"
 
-#: panel-plugin/wmdock.c:1225
+#: ../panel-plugin/props.c:492
 msgid "Shell command:"
 msgstr "Skalkommando:"
 
-#: panel-plugin/wmdock.c:1236
+#: ../panel-plugin/props.c:503
 msgid "Display tile in the background."
 msgstr "Visa bricka i bakgrunden."
 
-#: panel-plugin/wmdock.c:1237
-msgid ""
-"Display a separate WMdock properties\n"
-"button in the panel."
+#: ../panel-plugin/props.c:504
+#, fuzzy
+msgid "Display a separate WMdock properties button in the panel."
 msgstr ""
 "Visa en separat knapp för WMdock-\n"
 "egenskaper i panelen."
 
-#: panel-plugin/wmdock.c:1238
-msgid ""
-"Add only dockapps which start with\n"
-"wm* in the name."
+#: ../panel-plugin/props.c:505
+#, fuzzy
+msgid "Add only dockapps which start with pattern in list. (e.g.: ^wm;^as)"
 msgstr ""
 "Lägg endast till dockprogram som börjar\n"
 "med wm* i namnet."
 
+#: ../panel-plugin/props.c:506
+#, fuzzy
+msgid "Display dockapps in separate windows and not in the panel."
+msgstr ""
+"Visa en separat knapp för WMdock-\n"
+"egenskaper i panelen."
+
+#: ../panel-plugin/props.c:507
+msgid "Don't use panel size as offset for the first dockapp."
+msgstr ""
+
+#: ../panel-plugin/props.c:508
+msgid "Keep dockapp windows on top."
+msgstr ""
+
+#: ../panel-plugin/props.c:509
+msgid "Enable free positioning of the first dockapp on the screen."
+msgstr ""
+
+#: ../panel-plugin/props.c:538
+msgid ""
+"Hint: Is the first dockapp covered by a XFCE panel, please try to move the "
+"plugin\n"
+"to this panel to correct this problem."
+msgstr ""
+
+#: ../panel-plugin/props.c:542
+msgid "Placement:"
+msgstr ""
+
+#: ../panel-plugin/props.c:544
+msgid "Top left"
+msgstr ""
+
+#: ../panel-plugin/props.c:545
+msgid "Top right"
+msgstr ""
+
+#: ../panel-plugin/props.c:546
+msgid "Bottom left"
+msgstr ""
+
+#: ../panel-plugin/props.c:547
+msgid "Bottom right"
+msgstr ""
+
+#: ../panel-plugin/rcfile.c:93
+#, fuzzy, c-format
+msgid "Failed to start `%s'!"
+msgstr "Misslyckades med att starta %s!"
diff --git a/po/ur.po b/po/ur.po
index 4ad1369..de68ad8 100644
--- a/po/ur.po
+++ b/po/ur.po
@@ -7,10 +7,11 @@ msgid ""
 msgstr ""
 "Project-Id-Version: xfce4-wmdock-plugin\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-01-26 20:22+0100\n"
+"POT-Creation-Date: 2013-10-20 22:08+0200\n"
 "PO-Revision-Date: 2009-05-14 03:29+0500\n"
 "Last-Translator: Muhammad Ali Makki <makki.ma at gmail.com>\n"
 "Language-Team: Urdu <makki.ma at gmail.com>\n"
+"Language: ur\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=utf-8\n"
 "Content-Transfer-Encoding: 8bit\n"
@@ -19,61 +20,127 @@ msgstr ""
 "X-Poedit-Country: PAKISTAN\n"
 "X-Poedit-SourceCharset: utf-8\n"
 
-#: panel-plugin/wmdock.c:196
+#: ../panel-plugin/wmdock.c:190
+#, c-format
+msgid "Only a single instance of `%s' can run."
+msgstr ""
+
+#: ../panel-plugin/wmdock.c:193
+msgid "Only a single instance of `xfce4-wmdock-plugin' can run."
+msgstr ""
+
+#: ../panel-plugin/dnd.c:73
 #, c-format
 msgid "Do you want remove the dockapp \"%s\"?"
 msgstr "کیا آپ ڈوک ایپ dockapp کو حذف کرنا چاہتے ہیں \"%s\"؟"
 
-#: panel-plugin/wmdock.c:398
+#: ../panel-plugin/props.c:93
+msgid "Changes maybe not work properly until you restart XFCE!"
+msgstr ""
+
+#: ../panel-plugin/props.c:170
+msgid "Changes will take effect when you restart XFCE!"
+msgstr ""
+
+#: ../panel-plugin/props.c:386
 msgid "No dockapp is running!"
 msgstr "کوئی ڈوک ایپ dockapp نہیں چل رہا!"
 
-#: panel-plugin/wmdock.c:858
-#, c-format
-msgid "Failed to start %s!"
-msgstr "%s کو چلانے میں ناکامی!"
-
-#: panel-plugin/wmdock.c:1148
+#. Create the configure dialog.
+#: ../panel-plugin/props.c:415
 msgid "WMdock"
 msgstr "WMdock"
 
-#: panel-plugin/wmdock.c:1151
+#: ../panel-plugin/props.c:418
 msgid "Remove dockapp"
 msgstr "ڈوک ایپ dockapp حذف کریں"
 
-#: panel-plugin/wmdock.c:1167
+#: ../panel-plugin/props.c:434
 msgid "General settings"
 msgstr "عام ترتیبات"
 
-#: panel-plugin/wmdock.c:1168
+#: ../panel-plugin/props.c:435
 msgid "Dockapp detection"
 msgstr "ڈوک ایپ Dockapp دریافت"
 
-#: panel-plugin/wmdock.c:1216
+#: ../panel-plugin/props.c:436
+#, fuzzy
+msgid "Mode settings"
+msgstr "عام ترتیبات"
+
+#: ../panel-plugin/props.c:483
 msgid "Select dockapp to configure:"
 msgstr "وضع کرنے کے لیے ڈوک ایپ dockapp منتخب کریں:"
 
-#: panel-plugin/wmdock.c:1225
+#: ../panel-plugin/props.c:492
 msgid "Shell command:"
 msgstr "شیل کمانڈ:"
 
-#: panel-plugin/wmdock.c:1236
+#: ../panel-plugin/props.c:503
 msgid "Display tile in the background."
 msgstr "پس منظر میں ٹائل ظاہر کریں"
 
-#: panel-plugin/wmdock.c:1237
-msgid ""
-"Display a separate WMdock properties\n"
-"button in the panel."
+#: ../panel-plugin/props.c:504
+#, fuzzy
+msgid "Display a separate WMdock properties button in the panel."
 msgstr ""
 "پینل میں الگ WMdock خصوصیات\n"
 "بٹن ظاہر کریں."
 
-#: panel-plugin/wmdock.c:1238
-msgid ""
-"Add only dockapps which start with\n"
-"wm* in the name."
+#: ../panel-plugin/props.c:505
+#, fuzzy
+msgid "Add only dockapps which start with pattern in list. (e.g.: ^wm;^as)"
 msgstr ""
 "صرف وہ ڈوک ایپ dockapps شامل کریں جو\n"
 "جو نام میں wm* سے شروع ہوتے ہیں."
 
+#: ../panel-plugin/props.c:506
+#, fuzzy
+msgid "Display dockapps in separate windows and not in the panel."
+msgstr ""
+"پینل میں الگ WMdock خصوصیات\n"
+"بٹن ظاہر کریں."
+
+#: ../panel-plugin/props.c:507
+msgid "Don't use panel size as offset for the first dockapp."
+msgstr ""
+
+#: ../panel-plugin/props.c:508
+msgid "Keep dockapp windows on top."
+msgstr ""
+
+#: ../panel-plugin/props.c:509
+msgid "Enable free positioning of the first dockapp on the screen."
+msgstr ""
+
+#: ../panel-plugin/props.c:538
+msgid ""
+"Hint: Is the first dockapp covered by a XFCE panel, please try to move the "
+"plugin\n"
+"to this panel to correct this problem."
+msgstr ""
+
+#: ../panel-plugin/props.c:542
+msgid "Placement:"
+msgstr ""
+
+#: ../panel-plugin/props.c:544
+msgid "Top left"
+msgstr ""
+
+#: ../panel-plugin/props.c:545
+msgid "Top right"
+msgstr ""
+
+#: ../panel-plugin/props.c:546
+msgid "Bottom left"
+msgstr ""
+
+#: ../panel-plugin/props.c:547
+msgid "Bottom right"
+msgstr ""
+
+#: ../panel-plugin/rcfile.c:93
+#, fuzzy, c-format
+msgid "Failed to start `%s'!"
+msgstr "%s کو چلانے میں ناکامی!"
diff --git a/po/ur_PK.po b/po/ur_PK.po
index 4ad1369..de68ad8 100644
--- a/po/ur_PK.po
+++ b/po/ur_PK.po
@@ -7,10 +7,11 @@ msgid ""
 msgstr ""
 "Project-Id-Version: xfce4-wmdock-plugin\n"
 "Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2009-01-26 20:22+0100\n"
+"POT-Creation-Date: 2013-10-20 22:08+0200\n"
 "PO-Revision-Date: 2009-05-14 03:29+0500\n"
 "Last-Translator: Muhammad Ali Makki <makki.ma at gmail.com>\n"
 "Language-Team: Urdu <makki.ma at gmail.com>\n"
+"Language: ur\n"
 "MIME-Version: 1.0\n"
 "Content-Type: text/plain; charset=utf-8\n"
 "Content-Transfer-Encoding: 8bit\n"
@@ -19,61 +20,127 @@ msgstr ""
 "X-Poedit-Country: PAKISTAN\n"
 "X-Poedit-SourceCharset: utf-8\n"
 
-#: panel-plugin/wmdock.c:196
+#: ../panel-plugin/wmdock.c:190
+#, c-format
+msgid "Only a single instance of `%s' can run."
+msgstr ""
+
+#: ../panel-plugin/wmdock.c:193
+msgid "Only a single instance of `xfce4-wmdock-plugin' can run."
+msgstr ""
+
+#: ../panel-plugin/dnd.c:73
 #, c-format
 msgid "Do you want remove the dockapp \"%s\"?"
 msgstr "کیا آپ ڈوک ایپ dockapp کو حذف کرنا چاہتے ہیں \"%s\"؟"
 
-#: panel-plugin/wmdock.c:398
+#: ../panel-plugin/props.c:93
+msgid "Changes maybe not work properly until you restart XFCE!"
+msgstr ""
+
+#: ../panel-plugin/props.c:170
+msgid "Changes will take effect when you restart XFCE!"
+msgstr ""
+
+#: ../panel-plugin/props.c:386
 msgid "No dockapp is running!"
 msgstr "کوئی ڈوک ایپ dockapp نہیں چل رہا!"
 
-#: panel-plugin/wmdock.c:858
-#, c-format
-msgid "Failed to start %s!"
-msgstr "%s کو چلانے میں ناکامی!"
-
-#: panel-plugin/wmdock.c:1148
+#. Create the configure dialog.
+#: ../panel-plugin/props.c:415
 msgid "WMdock"
 msgstr "WMdock"
 
-#: panel-plugin/wmdock.c:1151
+#: ../panel-plugin/props.c:418
 msgid "Remove dockapp"
 msgstr "ڈوک ایپ dockapp حذف کریں"
 
-#: panel-plugin/wmdock.c:1167
+#: ../panel-plugin/props.c:434
 msgid "General settings"
 msgstr "عام ترتیبات"
 
-#: panel-plugin/wmdock.c:1168
+#: ../panel-plugin/props.c:435
 msgid "Dockapp detection"
 msgstr "ڈوک ایپ Dockapp دریافت"
 
-#: panel-plugin/wmdock.c:1216
+#: ../panel-plugin/props.c:436
+#, fuzzy
+msgid "Mode settings"
+msgstr "عام ترتیبات"
+
+#: ../panel-plugin/props.c:483
 msgid "Select dockapp to configure:"
 msgstr "وضع کرنے کے لیے ڈوک ایپ dockapp منتخب کریں:"
 
-#: panel-plugin/wmdock.c:1225
+#: ../panel-plugin/props.c:492
 msgid "Shell command:"
 msgstr "شیل کمانڈ:"
 
-#: panel-plugin/wmdock.c:1236
+#: ../panel-plugin/props.c:503
 msgid "Display tile in the background."
 msgstr "پس منظر میں ٹائل ظاہر کریں"
 
-#: panel-plugin/wmdock.c:1237
-msgid ""
-"Display a separate WMdock properties\n"
-"button in the panel."
+#: ../panel-plugin/props.c:504
+#, fuzzy
+msgid "Display a separate WMdock properties button in the panel."
 msgstr ""
 "پینل میں الگ WMdock خصوصیات\n"
 "بٹن ظاہر کریں."
 
-#: panel-plugin/wmdock.c:1238
-msgid ""
-"Add only dockapps which start with\n"
-"wm* in the name."
+#: ../panel-plugin/props.c:505
+#, fuzzy
+msgid "Add only dockapps which start with pattern in list. (e.g.: ^wm;^as)"
 msgstr ""
 "صرف وہ ڈوک ایپ dockapps شامل کریں جو\n"
 "جو نام میں wm* سے شروع ہوتے ہیں."
 
+#: ../panel-plugin/props.c:506
+#, fuzzy
+msgid "Display dockapps in separate windows and not in the panel."
+msgstr ""
+"پینل میں الگ WMdock خصوصیات\n"
+"بٹن ظاہر کریں."
+
+#: ../panel-plugin/props.c:507
+msgid "Don't use panel size as offset for the first dockapp."
+msgstr ""
+
+#: ../panel-plugin/props.c:508
+msgid "Keep dockapp windows on top."
+msgstr ""
+
+#: ../panel-plugin/props.c:509
+msgid "Enable free positioning of the first dockapp on the screen."
+msgstr ""
+
+#: ../panel-plugin/props.c:538
+msgid ""
+"Hint: Is the first dockapp covered by a XFCE panel, please try to move the "
+"plugin\n"
+"to this panel to correct this problem."
+msgstr ""
+
+#: ../panel-plugin/props.c:542
+msgid "Placement:"
+msgstr ""
+
+#: ../panel-plugin/props.c:544
+msgid "Top left"
+msgstr ""
+
+#: ../panel-plugin/props.c:545
+msgid "Top right"
+msgstr ""
+
+#: ../panel-plugin/props.c:546
+msgid "Bottom left"
+msgstr ""
+
+#: ../panel-plugin/props.c:547
+msgid "Bottom right"
+msgstr ""
+
+#: ../panel-plugin/rcfile.c:93
+#, fuzzy, c-format
+msgid "Failed to start `%s'!"
+msgstr "%s کو چلانے میں ناکامی!"


More information about the Xfce4-commits mailing list