[Bf-blender-cvs] [6dca5ff41f9] master: Cleanup: remove unused arg to wm_event_add_ghostevent

Campbell Barton noreply at git.blender.org
Mon Jun 3 15:58:45 CEST 2019


Commit: 6dca5ff41f9baa6fb27b862e270f6e27d7f16541
Author: Campbell Barton
Date:   Mon Jun 3 23:48:56 2019 +1000
Branches: master
https://developer.blender.org/rB6dca5ff41f9baa6fb27b862e270f6e27d7f16541

Cleanup: remove unused arg to wm_event_add_ghostevent

===================================================================

M	source/blender/windowmanager/intern/wm_event_system.c
M	source/blender/windowmanager/intern/wm_window.c
M	source/blender/windowmanager/wm_event_system.h

===================================================================

diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index 8fb7aacc04b..987c71398ee 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -4298,8 +4298,7 @@ static wmEvent *wm_event_add_mousemove(wmWindow *win, const wmEvent *event)
 
 /* windows store own event queues, no bContext here */
 /* time is in 1000s of seconds, from ghost */
-void wm_event_add_ghostevent(
-    wmWindowManager *wm, wmWindow *win, int type, int UNUSED(time), void *customdata)
+void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, void *customdata)
 {
   wmWindow *owin;
 
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index e9cf1cc5469..9ec7ec8e40f 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -1109,14 +1109,20 @@ void wm_window_reset_drawable(void)
   }
 }
 
-/* called by ghost, here we handle events for windows themselves or send to event system */
-/* mouse coordinate converversion happens here */
+/**
+ * Called by ghost, here we handle events for windows themselves or send to event system.
+ *
+ * Mouse coordinate conversion happens here.
+ */
 static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr C_void_ptr)
 {
   bContext *C = C_void_ptr;
   wmWindowManager *wm = CTX_wm_manager(C);
   GHOST_TEventType type = GHOST_GetEventType(evt);
-  int time = GHOST_GetEventTime(evt);
+#if 0
+  /* We may want to use time from ghost, currently `PIL_check_seconds_timer` is used instead. */
+  uint64_t time = GHOST_GetEventTime(evt);
+#endif
 
   if (type == GHOST_kEventQuitRequest) {
     /* Find an active window to display quit dialog in. */
@@ -1167,7 +1173,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr C_void_ptr
 
     switch (type) {
       case GHOST_kEventWindowDeactivate:
-        wm_event_add_ghostevent(wm, win, type, time, data);
+        wm_event_add_ghostevent(wm, win, type, data);
         win->active = 0; /* XXX */
 
         /* clear modifiers for inactive windows */
@@ -1210,7 +1216,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr C_void_ptr
         if (win->eventstate->shift) {
           if ((keymodifier & KM_SHIFT) == 0) {
             kdata.key = GHOST_kKeyLeftShift;
-            wm_event_add_ghostevent(wm, win, GHOST_kEventKeyUp, time, &kdata);
+            wm_event_add_ghostevent(wm, win, GHOST_kEventKeyUp, &kdata);
           }
         }
 #ifdef USE_WIN_ACTIVATE
@@ -1223,7 +1229,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr C_void_ptr
         if (win->eventstate->ctrl) {
           if ((keymodifier & KM_CTRL) == 0) {
             kdata.key = GHOST_kKeyLeftControl;
-            wm_event_add_ghostevent(wm, win, GHOST_kEventKeyUp, time, &kdata);
+            wm_event_add_ghostevent(wm, win, GHOST_kEventKeyUp, &kdata);
           }
         }
 #ifdef USE_WIN_ACTIVATE
@@ -1236,7 +1242,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr C_void_ptr
         if (win->eventstate->alt) {
           if ((keymodifier & KM_ALT) == 0) {
             kdata.key = GHOST_kKeyLeftAlt;
-            wm_event_add_ghostevent(wm, win, GHOST_kEventKeyUp, time, &kdata);
+            wm_event_add_ghostevent(wm, win, GHOST_kEventKeyUp, &kdata);
           }
         }
 #ifdef USE_WIN_ACTIVATE
@@ -1249,7 +1255,7 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr C_void_ptr
         if (win->eventstate->oskey) {
           if ((keymodifier & KM_OSKEY) == 0) {
             kdata.key = GHOST_kKeyOS;
-            wm_event_add_ghostevent(wm, win, GHOST_kEventKeyUp, time, &kdata);
+            wm_event_add_ghostevent(wm, win, GHOST_kEventKeyUp, &kdata);
           }
         }
 #ifdef USE_WIN_ACTIVATE
@@ -1506,18 +1512,18 @@ static int ghost_event_proc(GHOST_EventHandle evt, GHOST_TUserDataPtr C_void_ptr
         GHOST_TEventTrackpadData *pd = data;
 
         wm_cursor_position_from_ghost(win, &pd->x, &pd->y);
-        wm_event_add_ghostevent(wm, win, type, time, data);
+        wm_event_add_ghostevent(wm, win, type, data);
         break;
       }
       case GHOST_kEventCursorMove: {
         GHOST_TEventCursorData *cd = data;
 
         wm_cursor_position_from_ghost(win, &cd->x, &cd->y);
-        wm_event_add_ghostevent(wm, win, type, time, data);
+        wm_event_add_ghostevent(wm, win, type, data);
         break;
       }
       default:
-        wm_event_add_ghostevent(wm, win, type, time, data);
+        wm_event_add_ghostevent(wm, win, type, data);
         break;
     }
   }
diff --git a/source/blender/windowmanager/wm_event_system.h b/source/blender/windowmanager/wm_event_system.h
index 049e4d44994..55285b884da 100644
--- a/source/blender/windowmanager/wm_event_system.h
+++ b/source/blender/windowmanager/wm_event_system.h
@@ -138,8 +138,7 @@ void wm_event_free_handler(wmEventHandler *handler);
 /* goes over entire hierarchy:  events -> window -> screen -> area -> region */
 void wm_event_do_handlers(bContext *C);
 
-void wm_event_add_ghostevent(
-    wmWindowManager *wm, wmWindow *win, int type, int time, void *customdata);
+void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, int type, void *customdata);
 
 void wm_event_do_depsgraph(bContext *C);
 void wm_event_do_refresh_wm_and_depsgraph(bContext *C);



More information about the Bf-blender-cvs mailing list