[Xfce4-commits] <xfce4-wmdock-plugin:master> Begin to add a option to enable free positioning of the first dockapp.
Andre Ellguth
noreply at xfce.org
Mon Nov 4 13:36:36 CET 2013
Updating branch refs/heads/master
to 1dc25d2ff953e6869df442a27e0a0f347730c23d (commit)
from 489ca0e314640548c9f604493a19406df8334427 (commit)
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.
panel-plugin/dockapp.c | 4 +++-
panel-plugin/props.c | 28 +++++++++++++++++++---------
panel-plugin/rcfile.c | 2 ++
panel-plugin/rcfile.h | 23 ++++++++++++-----------
panel-plugin/wmdock.c | 1 +
panel-plugin/wmdock.h | 1 +
6 files changed, 38 insertions(+), 21 deletions(-)
diff --git a/panel-plugin/dockapp.c b/panel-plugin/dockapp.c
index 62eee81..cd15145 100644
--- a/panel-plugin/dockapp.c
+++ b/panel-plugin/dockapp.c
@@ -1043,7 +1043,9 @@ void wmdock_order_dockapps(DockappNode *dapp)
return;
for(i = 0; i < GLUE_MAX; i++) {
- wmdock_set_autoposition_dockapp(dapp, wmdock_get_parent_dockapp(dapp));
+ if(wmdock->propPanelOffFreePositioning == FALSE ||
+ (wmdock->propPanelOffFreePositioning == TRUE && dapp != wmdock_get_primary_anchor_dockapp()))
+ 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. */
diff --git a/panel-plugin/props.c b/panel-plugin/props.c
index 750aaa9..e4ae223 100644
--- a/panel-plugin/props.c
+++ b/panel-plugin/props.c
@@ -46,7 +46,7 @@ static struct {
GtkWidget *hbox, *hboxPanelOffOpts; /* Horizontal boxes */
GtkWidget *frmGeneral, *frmDetect, *frmPanelOffOpts; /* Frames */
GtkWidget *lblSel, *lblCmd, *lblPanelOffPlacement, *lblPanelOffHint; /* Labels */
- GtkWidget *chkDispTile, *chkPropButton, *chkAddOnlyWM, *chkPanelOff, *chkPanelOffIgnoreOffset, *chkPanelOffKeepAbove; /* Check boxes */
+ 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 */
@@ -76,8 +76,7 @@ static void wmdock_properties_chkdisptile(GtkToggleButton *gtkChkDispTile, gpoin
g_list_foreach(wmdock->dapps, (GFunc)wmdock_redraw_dockapp, NULL);
gtk_widget_show_all(GTK_WIDGET(wmdock->box));
- if( ! IS_PANELOFF(wmdock) )
- wmdock_msg_dialog(GTK_MESSAGE_INFO, _("Changes maybe not work properly until you restart XFCE!"));
+ wmdock_msg_dialog(GTK_MESSAGE_INFO, _("Changes maybe not work properly until you restart XFCE!"));
}
@@ -143,6 +142,9 @@ static void wmdock_properties_chkpaneloff(GtkToggleButton *gtkChkPanelOff, gpoin
gtk_widget_set_sensitive(GTK_WIDGET(prop.radioPanelOffBR), TRUE);
gtk_widget_set_sensitive(GTK_WIDGET(prop.radioPanelOffTL), TRUE);
gtk_widget_set_sensitive(GTK_WIDGET(prop.radioPanelOffTR), TRUE);
+ gtk_widget_set_sensitive(GTK_WIDGET(prop.chkPanelOffKeepAbove), TRUE);
+ gtk_widget_set_sensitive(GTK_WIDGET(prop.chkPanelOffFreePositioning), TRUE);
+ gtk_widget_set_sensitive(GTK_WIDGET(prop.chkPanelOffIgnoreOffset), TRUE);
gtk_widget_set_sensitive(GTK_WIDGET(prop.lblPanelOffPlacement), TRUE);
gtk_widget_set_sensitive(GTK_WIDGET(prop.lblPanelOffHint), TRUE);
} else {
@@ -150,6 +152,9 @@ static void wmdock_properties_chkpaneloff(GtkToggleButton *gtkChkPanelOff, gpoin
gtk_widget_set_sensitive(GTK_WIDGET(prop.radioPanelOffBR), FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(prop.radioPanelOffTL), FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(prop.radioPanelOffTR), FALSE);
+ gtk_widget_set_sensitive(GTK_WIDGET(prop.chkPanelOffKeepAbove), FALSE);
+ gtk_widget_set_sensitive(GTK_WIDGET(prop.chkPanelOffFreePositioning), FALSE);
+ gtk_widget_set_sensitive(GTK_WIDGET(prop.chkPanelOffIgnoreOffset), FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(prop.lblPanelOffPlacement), FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(prop.lblPanelOffHint), FALSE);
}
@@ -488,12 +493,13 @@ void wmdock_properties_dialog(XfcePanelPlugin *plugin)
}
gtk_box_pack_start (GTK_BOX(prop.vbox2), prop.txtCmd, FALSE, FALSE, 0);
- prop.chkDispTile = gtk_check_button_new_with_label(_("Display tile in the background."));
- prop.chkPropButton = gtk_check_button_new_with_label(_("Display a separate WMdock properties 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.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);
@@ -519,6 +525,7 @@ void wmdock_properties_dialog(XfcePanelPlugin *plugin)
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);
@@ -559,6 +566,9 @@ void wmdock_properties_dialog(XfcePanelPlugin *plugin)
gtk_widget_set_sensitive(GTK_WIDGET(prop.radioPanelOffBR), FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(prop.radioPanelOffTL), FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(prop.radioPanelOffTR), FALSE);
+ gtk_widget_set_sensitive(GTK_WIDGET(prop.chkPanelOffKeepAbove), FALSE);
+ gtk_widget_set_sensitive(GTK_WIDGET(prop.chkPanelOffFreePositioning), FALSE);
+ gtk_widget_set_sensitive(GTK_WIDGET(prop.chkPanelOffIgnoreOffset), FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(prop.lblPanelOffPlacement), FALSE);
gtk_widget_set_sensitive(GTK_WIDGET(prop.lblPanelOffHint), FALSE);
}
diff --git a/panel-plugin/rcfile.c b/panel-plugin/rcfile.c
index 9d94bab..aa3ae63 100644
--- a/panel-plugin/rcfile.c
+++ b/panel-plugin/rcfile.c
@@ -73,6 +73,7 @@ void wmdock_read_rc_file (XfcePanelPlugin *plugin)
rcPanelOff = wmdock->propPanelOff = xfce_rc_read_bool_entry (rc, RCKEY_PANELOFF, TRUE);
wmdock->propPanelOffIgnoreOffset = xfce_rc_read_bool_entry (rc, RCKEY_PANELOFFIGNOREOFFSET, FALSE);
wmdock->propPanelOffKeepAbove = xfce_rc_read_bool_entry (rc, RCKEY_PANELOFFKEEPABOVE, FALSE);
+ wmdock->propPanelOffFreePositioning = xfce_rc_read_bool_entry (rc, RCKEY_PANELOFFFREEPOSITIONING, FALSE);
glueList = IS_PANELOFF(wmdock) ? xfce_rc_read_list_entry(rc, RCKEY_GLUELIST, RC_LIST_DELIMITER) : NULL;
wmdock->anchorPos = xfce_rc_read_int_entry(rc, RCKEY_ANCHORPOS, -1);
xfce_rc_close (rc);
@@ -210,6 +211,7 @@ void wmdock_write_rc_file (XfcePanelPlugin *plugin)
xfce_rc_write_bool_entry (rc, RCKEY_PANELOFF, rcPanelOff);
xfce_rc_write_bool_entry (rc, RCKEY_PANELOFFIGNOREOFFSET, wmdock->propPanelOffIgnoreOffset);
xfce_rc_write_bool_entry (rc, RCKEY_PANELOFFKEEPABOVE, wmdock->propPanelOffKeepAbove);
+ xfce_rc_write_bool_entry (rc, RCKEY_PANELOFFFREEPOSITIONING, wmdock->propPanelOffFreePositioning);
xfce_rc_write_int_entry (rc, RCKEY_ANCHORPOS, wmdock->anchorPos);
xfce_rc_write_entry(rc, RCKEY_DAFILTER, wmdock->filterList);
}
diff --git a/panel-plugin/rcfile.h b/panel-plugin/rcfile.h
index 64794ba..d68174b 100644
--- a/panel-plugin/rcfile.h
+++ b/panel-plugin/rcfile.h
@@ -23,17 +23,18 @@
#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_DAFILTER (const gchar *) "dafilter"
-#define RCKEY_ANCHORPOS (const gchar *) "anchorpos"
-#define RCKEY_GLUELIST (const gchar *) "glues"
+#define RCKEY_CMDLIST (const gchar *) "cmds"
+#define RCKEY_CMDCNT (const gchar *) "cmdcnt"
+#define RCKEY_DISPTILE (const gchar *) "disptile"
+#define RCKEY_DISPPROPBTN (const gchar *) "disppropbtn"
+#define RCKEY_DISPADDONLYWM (const gchar *) "dispaddonlywm"
+#define RCKEY_PANELOFF (const gchar *) "paneloff"
+#define RCKEY_PANELOFFIGNOREOFFSET (const gchar *) "paneloffignoreoffset"
+#define RCKEY_PANELOFFKEEPABOVE (const gchar *) "paneloffkeepabove"
+#define RCKEY_PANELOFFFREEPOSITIONING (const gchar *) "panelofffreepositioning"
+#define RCKEY_DAFILTER (const gchar *) "dafilter"
+#define RCKEY_ANCHORPOS (const gchar *) "anchorpos"
+#define RCKEY_GLUELIST (const gchar *) "glues"
#define RC_LIST_DELIMITER (const gchar *) ";"
#define RC_GLUE_DELIMITER (const gchar *) ","
diff --git a/panel-plugin/wmdock.c b/panel-plugin/wmdock.c
index 3db8bcc..3fefefa 100644
--- a/panel-plugin/wmdock.c
+++ b/panel-plugin/wmdock.c
@@ -137,6 +137,7 @@ static WmdockPlugin *wmdock_plugin_new (XfcePanelPlugin* plugin)
wmdock->propPanelOff = TRUE;
wmdock->propPanelOffIgnoreOffset = FALSE;
wmdock->propPanelOffKeepAbove = FALSE;
+ wmdock->propPanelOffFreePositioning = FALSE;
wmdock->filterList = g_strdup(DOCKAPP_FILTER_PATTERN);
wmdock->anchorPos = get_default_anchor_postion();
diff --git a/panel-plugin/wmdock.h b/panel-plugin/wmdock.h
index 95aa7fd..a3ad67a 100644
--- a/panel-plugin/wmdock.h
+++ b/panel-plugin/wmdock.h
@@ -51,6 +51,7 @@ typedef struct {
gboolean propPanelOff;
gboolean propPanelOffIgnoreOffset;
gboolean propPanelOffKeepAbove;
+ gboolean propPanelOffFreePositioning;
AnchorPostion anchorPos;
gchar *filterList;
More information about the Xfce4-commits
mailing list