[Xfce4-commits] <xfce4-wmdock-plugin:master> Some changes to the dockapp movement.
Andre Ellguth
noreply at xfce.org
Mon Nov 4 13:36:10 CET 2013
Updating branch refs/heads/master
to df03e90a64c1883f54a240029a5ea2832c36771b (commit)
from 46586bf9fa10c33273a9066341516825f45e2798 (commit)
commit df03e90a64c1883f54a240029a5ea2832c36771b
Author: Andre Ellguth <andre at ellguth.com>
Date: Mon Jul 22 20:54:19 2013 +0200
Some changes to the dockapp movement.
panel-plugin/dockapp.c | 29 +++++++++++++++--------------
1 file changed, 15 insertions(+), 14 deletions(-)
diff --git a/panel-plugin/dockapp.c b/panel-plugin/dockapp.c
index 61c7ee9..40900b9 100644
--- a/panel-plugin/dockapp.c
+++ b/panel-plugin/dockapp.c
@@ -160,12 +160,12 @@ static DockappNode *wmdock_get_snapable_dockapp(DockappNode *dapp, gint *gluepos
case XFCE_SCREEN_POSITION_NW_H:
case XFCE_SCREEN_POSITION_N:
case XFCE_SCREEN_POSITION_NE_H:
- possible^= prim == TRUE ? GLUE_T : 0;
+ possible^= prim == TRUE ? (GLUE_T | GLUE_R) : 0;
break;
case XFCE_SCREEN_POSITION_SW_H:
case XFCE_SCREEN_POSITION_S:
case XFCE_SCREEN_POSITION_SE_H:
- possible^= prim == TRUE ? GLUE_B : 0;
+ possible^= prim == TRUE ? (GLUE_B | GLUE_R): 0;
break;
case XFCE_SCREEN_POSITION_NW_V:
case XFCE_SCREEN_POSITION_W:
@@ -231,7 +231,7 @@ static void wmdock_remove_anchors_tile_dummy()
/**
* Replace dummy DockApp with the moved DockApp.
*
- * @param dapp Replacement Dockapp.
+ * @param dapp Replacement dockapp.
* @return TRUE if dummy tile is replaced else FALSE.
*/
static gboolean wmdock_replace_tile_dummy(DockappNode *dapp)
@@ -282,15 +282,19 @@ void wmdock_dockapp_paneloff_handler(GtkWidget *tile, GdkEvent *ev, DockappNode
gint gluepos;
GdkModifierType gdkmodtype;
- debug("dockapp.c: Window event after: %d. (dapp: %s), dappOnMove: %s", ev->type, dapp->name,
+ debug("dockapp.c: Window event after: %d. (dapp: `%s'), dappOnMove: %s", ev->type, dapp->name,
dappOnMove ? "Yes": "No");
switch(ev->type) {
- case GDK_BUTTON_PRESS:
- case GDK_KEY_PRESS:
- dappOnMove = dapp;
- break;
- case GDK_CONFIGURE: /* Movement. */
+ case GDK_CONFIGURE:
+ gdk_window_get_pointer(tile->window, NULL, NULL, &gdkmodtype);
+ if(!dappOnMove && gdkmodtype & GDK_BUTTON1_MASK) {
+ /* Movement. */
+ debug("dockapp.c: Start dockapp movement (dapp: `%s')", dapp->name);
+ dappOnMove = dapp;
+ gtk_window_set_keep_above(GTK_WINDOW(dapp->tile), TRUE);
+ }
+
if(dappOnMove) {
wmdock_remove_anchors_tile_dummy();
dappSnap = wmdock_get_snapable_dockapp(dapp, &gluepos);
@@ -327,6 +331,7 @@ void wmdock_dockapp_paneloff_handler(GtkWidget *tile, GdkEvent *ev, DockappNode
if(dappDummy) {
gtk_widget_hide(dappDummy->tile);
}
+ gtk_window_set_keep_above(GTK_WINDOW(dapp->tile), FALSE);
dappOnMove = NULL;
break;
@@ -335,9 +340,6 @@ void wmdock_dockapp_paneloff_handler(GtkWidget *tile, GdkEvent *ev, DockappNode
/* `in' is true if window window got the focus. */
g_list_foreach(wmdock->dapps, (GFunc) wmdock_dockapp_tofront, NULL);
}
- if(dappOnMove) {
- //wmdock_set_autoposition_dockapp(dapp, wmdock_get_parent_dockapp(dapp));
- }
break;
case GDK_VISIBILITY_NOTIFY:
wmdock_redraw_dockapp(dapp);
@@ -375,8 +377,7 @@ GtkWidget *wmdock_create_tile_dummy()
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);
- gtk_window_set_keep_below(GTK_WINDOW(dummy), TRUE);
- gtk_window_set_type_hint(GTK_WINDOW(dummy), GDK_WINDOW_TYPE_HINT_DND);
+// gtk_window_set_type_hint(GTK_WINDOW(dummy), GDK_WINDOW_TYPE_HINT_DND);
return (dummy);
}
More information about the Xfce4-commits
mailing list