← Back to team overview

cairo-dock-team team mailing list archive

[Bug 614843] Re: dock doesn't shrink

 

>>I think there is here a kind of conflict between the dock and the actions in
>>Compiz.
At first I thought there is, but it seems a bug in cairo-dock.
for example "Docky" woks ok, because it uses mouse polling (I think).
This happens when there is another window over cairo-dock.

>>what kind of action did you link to the bottom screen edge ?
Switch between desktops of desktop wall.
Do you have same problem? or it is me alone?

>>wouldn't it be possible to link it to another edge ?
I don't think. I use every edge to move to another desktop. all edges have link.

>>did you try to just comment the _mouse_is_really_outside function ?
Yes. but it didnot work, it seems in that way some animation should be patched too. 
because after "leave-notify" no more mouse movement is sent to cairo dock until another "enter-notify" and this happens when another window is on the cairo-dock. which seems that compiz uses some on the edges. 
so using mouse polling instead of "motion-notify"

-- 
dock doesn't shrink
https://bugs.launchpad.net/bugs/614843
You received this bug notification because you are a member of Cairo-
Dock Team, which is subscribed to Cairo-Dock Core.

Status in Cairo-Dock : Core: New

Bug description:
Some times dock doesn't shrink when leave-notify is sent to dock but _mouse_is_really_outside is false.
for example when compiz is on (and desktop wall) if dock is in the bottom, when mouse gets out of dock towards the bottom edge and while on edge gets out of dock, dock doesn't shrink. this patch worked for me. using mouse polling if in leave-notify the _mouse_is_really_outside is false.
version cairo-dock 2.2.0-0beta3 using  ppa and ubuntu 10.04 , 64 bit
cairo-dock-core_2.2.0-0beta3-20100724-0ubuntu1~ppa0~lucid_amd64.deb

======== PATCH ========
diff -c -r -b A/src/gldit/cairo-dock-callbacks.c B/src/gldit/cairo-dock-callbacks.c
*** A/src/gldit/cairo-dock-callbacks.c	2010-07-24 18:42:00.000000000 +0430
--- B/src/gldit/cairo-dock-callbacks.c	2010-08-08 00:59:35.000000000 +0430
***************
*** 537,542 ****
--- 537,597 ----
  	return FALSE;
  }
  
+ gboolean on_mouse_polling(CairoDock *pDock);
+ 
+ gboolean on_mouse_polling(CairoDock *pDock)
+ {
+ 	gint x, y;
+ 	// get the mouse position
+ 	gdk_display_get_pointer (gdk_display_get_default(), NULL, &x, &y, NULL);
+ 	
+ 	// calculate mouse position realative to the widget
+ 	pDock->container.iMouseX=x-pDock->container.iWindowPositionX;
+ 	pDock->container.iMouseY=y-pDock->container.iWindowPositionY;
+ 	
+ 	// if mouse is outside send a leave notify
+ 	if(_mouse_is_really_outside(pDock))
+ 	{
+ 		// TODO: use a better way
+ 		GdkEventCrossing eventCrossing;
+ 		eventCrossing.x_root=x;
+ 		eventCrossing.y_root=y;
+ 		eventCrossing.x=pDock->container.iMouseX;
+ 		eventCrossing.y=pDock->container.iMouseY;
+ 		eventCrossing.state=0;
+ 		eventCrossing.window=pDock->container.pWidget;
+ 		eventCrossing.subwindow=eventCrossing.window;
+ 		eventCrossing.type=GDK_LEAVE_NOTIFY;
+ 		eventCrossing.send_event=1;
+ 		eventCrossing.detail=GDK_NOTIFY_NONLINEAR;
+ 		eventCrossing.mode=GDK_CROSSING_NORMAL;
+ 		eventCrossing.focus=FALSE;
+ 		
+ 		cairo_dock_on_leave_notify(pDock->container.pWidget,&eventCrossing,pDock);
+ 		return FALSE;
+ 	}
+ 	// otherwise if mouse is in, send a motion notify
+ 	else
+ 	{
+ 		// TODO: use a better way
+ 		GdkEventMotion eventMotion;
+ 		eventMotion.x_root=x;
+ 		eventMotion.y_root=y;
+ 		eventMotion.x=pDock->container.iMouseX;
+ 		eventMotion.y=pDock->container.iMouseY;
+ 		eventMotion.axes=NULL;
+ 		eventMotion.state=0;
+ 		eventMotion.is_hint=0;
+ 		eventMotion.window=pDock->container.pWidget;
+ 		eventMotion.device=NULL;
+ 		eventMotion.type=GDK_MOTION_NOTIFY;
+ 		eventMotion.send_event=1;
+ 		
+ 		cairo_dock_on_motion_notify(pDock->container.pWidget,&eventMotion,pDock);
+ 		return TRUE;
+ 	}
+ 	
+ }
  
  gboolean cairo_dock_on_leave_notify (GtkWidget* pWidget, GdkEventCrossing* pEvent, CairoDock *pDock)
  {
***************
*** 563,568 ****
--- 619,625 ----
  		if (!_mouse_is_really_outside(pDock))
  		{
  			//g_print ("not really outside (%d;%d ; %d/%d)\n", (int)pEvent->x, (int)pEvent->y, pDock->iMaxDockHeight, pDock->iMinDockHeight);
+ 			pDock->iMousePollingSource=g_timeout_add(cairo_dock_get_animation_delta_t(pDock),(GSourceFunc)on_mouse_polling,pDock); //maybe it is better to be adjusted
  			return FALSE;
  		}
  	}
***************
*** 693,698 ****
--- 754,766 ----
  gboolean cairo_dock_on_enter_notify (GtkWidget* pWidget, GdkEventCrossing* pEvent, CairoDock *pDock)
  {
  	//g_print ("%s (bIsMainDock : %d; bInside:%d; state:%d; iMagnitudeIndex:%d; input shape:%x; event:%ld)\n", __func__, pDock->bIsMainDock, pDock->container.bInside, pDock->iInputState, pDock->iMagnitudeIndex, pDock->pShapeBitmap, pEvent);
+ 	
+ 	if(pDock->iMousePollingSource!=0)
+ 	{
+ 		g_source_remove(pDock->iMousePollingSource);
+ 		pDock->iMousePollingSource=0;
+ 	}
+ 	
  	s_pLastPointedDock = NULL;  // ajoute le 04/10/07 pour permettre aux sous-docks d'apparaitre si on entre en pointant tout de suite sur l'icone.
  	if (! cairo_dock_entrance_is_allowed (pDock))
  	{
diff -c -r -b A/src/gldit/cairo-dock-dock-factory.h B/src/gldit/cairo-dock-dock-factory.h
*** A/src/gldit/cairo-dock-dock-factory.h	2010-07-24 18:42:00.000000000 +0430
--- B/src/gldit/cairo-dock-dock-factory.h	2010-08-08 00:45:50.000000000 +0430
***************
*** 261,268 ****
  	guint iSidLoadBg;
  	
  	gint iNbDrawnIcons;
  	
! 	gchar reserved[12];
  };
  
  
--- 261,269 ----
  	guint iSidLoadBg;
  	
  	gint iNbDrawnIcons;
+ 	guint iMousePollingSource;
  	
! 	gchar reserved[8];
  };





Follow ups

References