Add input event source information 60/39160/1
authorSung-jae Park <nicesj.park@samsung.com>
Thu, 7 May 2015 06:04:09 +0000 (15:04 +0900)
committerSung-jae Park <nicesj.park@samsung.com>
Thu, 7 May 2015 06:04:09 +0000 (15:04 +0900)
Change-Id: If9510b18c2d06a6ab10e30d15454d48a221ac502

src/virtual_window.c

index 288ef65..8766611 100644 (file)
@@ -60,12 +60,17 @@ static inline Evas_Object *get_highlighted_object(Evas_Object *obj)
        return ho;
 }
 
-static inline void apply_orientation(int degree, int *x, int *y)
+static inline void apply_orientation(int degree, int *x, int *y, input_event_source_e source)
 {
        int _x;
        int _y;
        int _angle;
 
+       if (source == INPUT_EVENT_SOURCE_VIEWER) {
+               /* Already rotated */
+               return;
+       }
+
        switch (degree) {
        case 0:
                return;
@@ -192,7 +197,7 @@ static int event_handler_cb(widget_buffer_h handler, struct widget_buffer_event_
                evas_event_feed_mouse_out(info->e, timestamp, NULL);
                break;
        case WIDGET_BUFFER_EVENT_DOWN:
-               apply_orientation(info->orientation, &event_info->info.pointer.x, &event_info->info.pointer.y);
+               apply_orientation(info->orientation, &event_info->info.pointer.x, &event_info->info.pointer.y, event_info->info.pointer.source);
 
                if (info->pressed) {
                        ErrPrint("MOUSE UP is not called\n");
@@ -221,7 +226,7 @@ static int event_handler_cb(widget_buffer_h handler, struct widget_buffer_event_
                ErrPrint("DOWN[%s] %dx%d - %lf\n", info->id, event_info->info.pointer.x, event_info->info.pointer.y, timestamp);
                break;
        case WIDGET_BUFFER_EVENT_MOVE:
-               apply_orientation(info->orientation, &event_info->info.pointer.x, &event_info->info.pointer.y);
+               apply_orientation(info->orientation, &event_info->info.pointer.x, &event_info->info.pointer.y, event_info->info.pointer.source);
                /**
                 * @note
                 * Calculate the event occurred X & Y on the buffer
@@ -229,7 +234,7 @@ static int event_handler_cb(widget_buffer_h handler, struct widget_buffer_event_
                evas_event_feed_mouse_move(info->e, event_info->info.pointer.x, event_info->info.pointer.y, timestamp, NULL);
                break;
        case WIDGET_BUFFER_EVENT_UP:
-               apply_orientation(info->orientation, &event_info->info.pointer.x, &event_info->info.pointer.y);
+               apply_orientation(info->orientation, &event_info->info.pointer.x, &event_info->info.pointer.y, event_info->info.pointer.source);
                evas_event_feed_mouse_move(info->e, event_info->info.pointer.x, event_info->info.pointer.y, timestamp, NULL);
                evas_event_feed_mouse_up(info->e, 1, EVAS_BUTTON_NONE, timestamp, NULL);
                info->pressed = 0;