[Xfce4-commits] [xfce/xfce4-settings] 01/01: Fix display DND issue introduced with GTK3 migration (tested with 2 displays)
noreply at xfce.org
noreply at xfce.org
Wed Jun 14 04:35:15 CEST 2017
This is an automated email from the git hooks/post-receive script.
b l u e s a b r e p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository xfce/xfce4-settings.
commit 0324f0f6da0bd659b698af4ce664f3de40c262fa
Author: Sean Davis <smd.seandavis at gmail.com>
Date: Tue Jun 13 22:35:09 2017 -0400
Fix display DND issue introduced with GTK3 migration (tested with 2 displays)
---
dialogs/display-settings/main.c | 3 +++
dialogs/display-settings/scrollarea.c | 49 +++++------------------------------
dialogs/display-settings/scrollarea.h | 3 ++-
3 files changed, 12 insertions(+), 43 deletions(-)
diff --git a/dialogs/display-settings/main.c b/dialogs/display-settings/main.c
index 3d96df1..624432b 100644
--- a/dialogs/display-settings/main.c
+++ b/dialogs/display-settings/main.c
@@ -2239,6 +2239,9 @@ on_output_event (FooScrollArea *area,
* on_canvas_event() for where we reset the cursor to the default if it
* exits the outputs' area.
*/
+ if (event->type == FOO_MOTION_OUTSIDE)
+ return;
+
if (!get_mirrored_configuration() && get_n_connected() > 1)
set_cursor (GTK_WIDGET (area), GDK_FLEUR);
diff --git a/dialogs/display-settings/scrollarea.c b/dialogs/display-settings/scrollarea.c
index c4d6e39..b698bcd 100644
--- a/dialogs/display-settings/scrollarea.c
+++ b/dialogs/display-settings/scrollarea.c
@@ -322,36 +322,6 @@ typedef void (* PathForeachFunc) (double *x,
double *y,
gpointer data);
-static void
-path_foreach_point (cairo_path_t *path,
- PathForeachFunc func,
- gpointer user_data)
-{
- int i;
-
- for (i = 0; i < path->num_data; i += path->data[i].header.length)
- {
- cairo_path_data_t *data = &(path->data[i]);
-
- switch (data->header.type)
- {
- case CAIRO_PATH_MOVE_TO:
- case CAIRO_PATH_LINE_TO:
- func (&(data[1].point.x), &(data[1].point.y), user_data);
- break;
-
- case CAIRO_PATH_CURVE_TO:
- func (&(data[1].point.x), &(data[1].point.y), user_data);
- func (&(data[2].point.x), &(data[2].point.y), user_data);
- func (&(data[3].point.x), &(data[3].point.y), user_data);
- break;
-
- case CAIRO_PATH_CLOSE_PATH:
- break;
- }
- }
-}
-
typedef struct
{
double x1, y1, x2, y2;
@@ -749,7 +719,7 @@ emit_input (FooScrollArea *scroll_area,
if (!func)
return;
- if (type != FOO_MOTION)
+ if (type != FOO_MOTION && type != FOO_MOTION_OUTSIDE)
emit_input (scroll_area, FOO_MOTION, x, y, func, data);
event.type = type;
@@ -814,6 +784,12 @@ G_GNUC_END_IGNORE_DEPRECATIONS
path->data);
return;
}
+ else if (input_type == FOO_MOTION) {
+ emit_input (scroll_area, FOO_MOTION_OUTSIDE,
+ x, y,
+ path->func,
+ path->data);
+ }
path = path->next;
}
@@ -1125,16 +1101,6 @@ foo_scroll_area_set_min_size (FooScrollArea *scroll_area,
gtk_widget_queue_resize (GTK_WIDGET (scroll_area));
}
-static void
-user_to_device (double *x,
- double *y,
- gpointer data)
-{
- cairo_t *cr = data;
-
- cairo_user_to_device (cr, x, y);
-}
-
static InputPath *
make_path (FooScrollArea *area,
cairo_t *cr,
@@ -1148,7 +1114,6 @@ make_path (FooScrollArea *area,
path->fill_rule = cairo_get_fill_rule (cr);
path->line_width = cairo_get_line_width (cr);
path->path = cairo_copy_path (cr);
- path_foreach_point (path->path, user_to_device, cr);
path->func = func;
path->data = data;
path->next = area->priv->current_input->paths;
diff --git a/dialogs/display-settings/scrollarea.h b/dialogs/display-settings/scrollarea.h
index 491363d..eed39cb 100644
--- a/dialogs/display-settings/scrollarea.h
+++ b/dialogs/display-settings/scrollarea.h
@@ -47,7 +47,8 @@ typedef enum
{
FOO_BUTTON_PRESS,
FOO_BUTTON_RELEASE,
- FOO_MOTION
+ FOO_MOTION,
+ FOO_MOTION_OUTSIDE
} FooScrollAreaEventType;
struct FooScrollAreaEvent
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list