rpms/compiz/devel double-click.patch, NONE, 1.1 compiz.spec, 1.36, 1.37
fedora-cvs-commits at redhat.com
fedora-cvs-commits at redhat.com
Thu Sep 14 21:57:44 UTC 2006
Author: sandmann
Update of /cvs/dist/rpms/compiz/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv19633
Modified Files:
compiz.spec
Added Files:
double-click.patch
Log Message:
Add patch to fix double clicking, 201783
double-click.patch:
gnome-window-decorator.c | 29 ++++++++++++++++++++++++++---
1 files changed, 26 insertions(+), 3 deletions(-)
--- NEW FILE double-click.patch ---
--- compiz-3173a142efe5e7af83ebb534a074d9d2a0c67a86/gnome/window-decorator/gnome-window-decorator.c.double-click 2006-08-17 17:36:07.000000000 -0400
+++ compiz-3173a142efe5e7af83ebb534a074d9d2a0c67a86/gnome/window-decorator/gnome-window-decorator.c 2006-09-14 17:42:58.000000000 -0400
@@ -105,6 +105,8 @@
#define ICON_SPACE 20
+#define DOUBLE_CLICK_DISTANCE 8.0
+
typedef struct _extents {
gint left;
gint right;
@@ -3708,6 +3710,19 @@
action_menu_mapped = TRUE;
}
+static double
+square (double x)
+{
+ return x * x;
+}
+
+static double
+dist (double x1, double y1,
+ double x2, double y2)
+{
+ return sqrt (square (x1 - x2) + square (y1 - y2));
+}
+
static void
title_event (WnckWindow *win,
XEvent *xevent)
@@ -3715,15 +3730,19 @@
static int last_button_num = 0;
static Window last_button_xwindow = None;
static Time last_button_time = 0;
+ static int last_button_x = 0;
+ static int last_button_y = 0;
if (xevent->type != ButtonPress)
return;
if (xevent->xbutton.button == 1)
{
- if (xevent->xbutton.button == last_button_num &&
- xevent->xbutton.window == last_button_xwindow &&
- xevent->xbutton.time < last_button_time + double_click_timeout)
+ if (xevent->xbutton.button == last_button_num &&
+ xevent->xbutton.window == last_button_xwindow &&
+ xevent->xbutton.time < last_button_time + double_click_timeout &&
+ dist (xevent->xbutton.x, xevent->xbutton.y,
+ last_button_x, last_button_y) < DOUBLE_CLICK_DISTANCE)
{
switch (double_click_action) {
case DOUBLE_CLICK_SHADE:
@@ -3744,12 +3763,16 @@
last_button_num = 0;
last_button_xwindow = None;
last_button_time = 0;
+ last_button_x = 0;
+ last_button_y = 0;
}
else
{
last_button_num = xevent->xbutton.button;
last_button_xwindow = xevent->xbutton.window;
last_button_time = xevent->xbutton.time;
+ last_button_x = xevent->xbutton.x;
+ last_button_y = xevent->xbutton.y;
restack_window (win, Above);
Index: compiz.spec
===================================================================
RCS file: /cvs/dist/rpms/compiz/devel/compiz.spec,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -r1.36 -r1.37
--- compiz.spec 12 Sep 2006 21:19:43 -0000 1.36
+++ compiz.spec 14 Sep 2006 21:57:42 -0000 1.37
@@ -47,6 +47,7 @@
Patch106: glfinish.patch
Patch107: cow.patch
Patch108: plane.patch
+Patch109: double-click.patch
%description
Compiz is one of the first OpenGL-accelerated compositing window
@@ -84,6 +85,7 @@
%patch106 -p1 -b .glfinish
%patch107 -p1 -b .cow
%patch108 -p1 -b .plane
+%patch109 -p1 -b .double-click
%build
rm -rf $RPM_BUILD_ROOT
@@ -152,6 +154,9 @@
%{_includedir}/compiz
%changelog
+* Thu Sep 14 2006 Soren Sandmann <sandmann at redhat.com>
+- Add patch to fix double clicking (bug 201783).
+
* Tue Sep 12 2006 Soren Sandmann <sandmann at redhat.com>
- Don't attempt to move the viewport when dx = dy = 0.(last bit of 206088).
More information about the fedora-cvs-commits
mailing list