summaryrefslogtreecommitdiff
diff options
-rw-r--r--targets/mutter/plugin.vala75
-rw-r--r--targets/mutter/spaces-manager.vala1
-rw-r--r--unity-private/gesture/gesture-dispatcher-xcb-glue.c1
-rw-r--r--unity-private/launcher/scroller-view.vala3
-rw-r--r--unity-private/testing/background.vala5
5 files changed, 77 insertions, 8 deletions
diff --git a/targets/mutter/plugin.vala b/targets/mutter/plugin.vala
index 077b0a812..0a9eb8a9d 100644
--- a/targets/mutter/plugin.vala
+++ b/targets/mutter/plugin.vala
@@ -46,6 +46,7 @@ namespace Unity
ZERO,
}
+ /*
public class ActorBlur : Ctk.Bin
{
private Clutter.Clone clone;
@@ -70,6 +71,7 @@ namespace Unity
}
}
+ */
public class Plugin : Object, Shell
{
/* Signals */
@@ -160,7 +162,16 @@ namespace Unity
private dynamic DBus.Object screensaver;
public Gesture.Dispatcher gesture_dispatcher;
+
+ /* Pinch info */
private float start_pinch_radius = 0.0f;
+ private unowned Mutter.Window? resize_window = null;
+ private float resize_last_x1 = 0.0f;
+ private float resize_last_y1 = 0.0f;
+ private float resize_last_x2 = 0.0f;
+ private float resize_last_y2 = 0.0f;
+
+ /* Pan info */
private unowned Mutter.Window? start_pan_window = null;
private unowned Clutter.Rectangle? start_frame_rect = null;
private float last_pan_x_root = 0.0f;
@@ -787,8 +798,7 @@ namespace Unity
{
if (event.fingers == 3)
{
- debug ("Move Window");
- print (@"$event");
+ ;
}
else if (event.fingers == 4)
{
@@ -801,6 +811,65 @@ namespace Unity
if (event.fingers == 3)
{
debug ("Resize Window");
+
+ if (event.state == Gesture.State.BEGAN)
+ {
+ resize_window = null;
+
+ var actor = stage.get_actor_at_pos (Clutter.PickMode.ALL,
+ (int)event.root_x,
+ (int)event.root_y);
+ if (actor is Mutter.Window == false)
+ actor = actor.get_parent ();
+
+ if (actor is Mutter.Window)
+ {
+ resize_window = actor as Mutter.Window;
+ resize_last_x1 = event.pinch_event.bounding_box_x1;
+ resize_last_y1 = event.pinch_event.bounding_box_y1;
+ resize_last_x2 = event.pinch_event.bounding_box_x2;
+ resize_last_y2 = event.pinch_event.bounding_box_y2;
+ }
+ }
+ else if (event.state == Gesture.State.CONTINUED)
+ {
+ if (resize_window is Mutter.Window == false)
+ return;
+
+ print ("RESIZE: %f %f %f %f\n",
+ resize_last_x1 - event.pinch_event.bounding_box_x1,
+ resize_last_y1 - event.pinch_event.bounding_box_y1,
+ resize_last_x2 - event.pinch_event.bounding_box_x2,
+ resize_last_y2 - event.pinch_event.bounding_box_y2);
+
+ var nx = resize_window.x;
+ var ny = resize_window.y;
+ var nwidth = resize_window.width;
+ var nheight = resize_window.height;
+
+ nx += resize_last_x1 - event.pinch_event.bounding_box_x1;
+ ny += resize_last_y1 - event.pinch_event.bounding_box_y1;
+ nwidth += resize_last_x2 - event.pinch_event.bounding_box_x2;
+ nheight += resize_last_y2 - event.pinch_event.bounding_box_y2;
+
+ Mutter.MetaWindow.move_resize (resize_window.get_meta_window (),
+ false,
+ (int)nx,
+ (int)ny,
+ (int)nwidth,
+ (int)nheight);
+
+ resize_last_x1 = event.pinch_event.bounding_box_x1;
+ resize_last_y1 = event.pinch_event.bounding_box_y1;
+ resize_last_x2 = event.pinch_event.bounding_box_x2;
+ resize_last_y2 = event.pinch_event.bounding_box_y2;
+ }
+ else if (event.state == Gesture.State.ENDED)
+ {
+ if (resize_window is Mutter.Window == false)
+ return;
+ }
+ //print (@"$event\n");
}
else if (event.fingers == 4)
{
@@ -1079,7 +1148,7 @@ namespace Unity
float nheight = 0;
bool move_resize = false;
- print (@"$event\n");
+ //print (@"$event\n");
if (start_pan_window.y == PANEL_HEIGHT)
{
diff --git a/targets/mutter/spaces-manager.vala b/targets/mutter/spaces-manager.vala
index 39d95226b..a37cbc186 100644
--- a/targets/mutter/spaces-manager.vala
+++ b/targets/mutter/spaces-manager.vala
@@ -295,7 +295,6 @@ namespace Unity {
unowned GLib.List<Mutter.Window> windows;
windows = plugin.plugin.get_windows ();
- List<Clutter.Actor> toplevel_windows = new List<Clutter.Actor> ();
wsp = new WorkspaceClone (workspace, plugin);
foreach (Mutter.Window window in windows)
diff --git a/unity-private/gesture/gesture-dispatcher-xcb-glue.c b/unity-private/gesture/gesture-dispatcher-xcb-glue.c
index 5ee8d1fc0..680fbb989 100644
--- a/unity-private/gesture/gesture-dispatcher-xcb-glue.c
+++ b/unity-private/gesture/gesture-dispatcher-xcb-glue.c
@@ -124,7 +124,6 @@ unity_gesture_xcb_dispatcher_glue_finish ()
void
unity_gesture_xcb_dispatcher_glue_main_iteration (XCBSource *source)
{
- g_debug ("%s", G_STRFUNC);
const xcb_query_extension_reply_t *extension_info;
xcb_connection_t *connection = source->connection;
diff --git a/unity-private/launcher/scroller-view.vala b/unity-private/launcher/scroller-view.vala
index c2a144887..1aa98a11b 100644
--- a/unity-private/launcher/scroller-view.vala
+++ b/unity-private/launcher/scroller-view.vala
@@ -471,9 +471,6 @@ namespace Unity.Launcher
Cairo.TextExtents real_extents = Cairo.TextExtents ();
cr.text_extents (text, out extents);
- double w_diff = extents.width - real_extents.width;
- double h_diff = extents.height - real_extents.height;
-
w += extents.width;
h += extents.height;
cr.set_source_rgba (0.07, 0.07, 0.07, 0.8);
diff --git a/unity-private/testing/background.vala b/unity-private/testing/background.vala
index b015563b9..17c84b2ee 100644
--- a/unity-private/testing/background.vala
+++ b/unity-private/testing/background.vala
@@ -45,6 +45,11 @@ namespace Unity.Testing
private string sec_col;
private string filename;
+ public Background ()
+ {
+ Object ();
+ }
+
construct
{
START_FUNCTION ();