Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-05-20 15:04:59 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-05-20 15:07:55 +0300
commiteb57377f12123587a894582458c46aa09ef7c61d (patch)
tree8d2093c91966addaa1485a6112e1058dfff692bf /source/blender/windowmanager
parent7d3bf5166d6782b0e6cde48c1a998414d83aba9d (diff)
Fix T76794: Number button cursor overrides eyedropper cursor
Pressing 'E' over a number button to pick a distance was keeping left-right arrows instead of using the eye-dropper cursor. Workaround this by clearing the active button before setting the cursor.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c18
-rw-r--r--source/blender/windowmanager/wm_event_system.h5
-rw-r--r--source/blender/windowmanager/wm_event_types.h1
3 files changed, 19 insertions, 5 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index d71b722ddb0..136c24f8056 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -640,11 +640,11 @@ static int wm_handler_ui_call(bContext *C,
return WM_HANDLER_CONTINUE;
}
-static void wm_handler_ui_cancel(bContext *C)
+void wm_event_handler_ui_cancel_ex(bContext *C,
+ wmWindow *win,
+ ARegion *region,
+ bool reactivate_button)
{
- wmWindow *win = CTX_wm_window(C);
- ARegion *region = CTX_wm_region(C);
-
if (!region) {
return;
}
@@ -656,11 +656,19 @@ static void wm_handler_ui_cancel(bContext *C)
wmEvent event;
wm_event_init_from_window(win, &event);
event.type = EVT_BUT_CANCEL;
+ event.val = reactivate_button ? 0 : 1;
handler->handle_fn(C, &event, handler->user_data);
}
}
}
+static void wm_event_handler_ui_cancel(bContext *C)
+{
+ wmWindow *win = CTX_wm_window(C);
+ ARegion *region = CTX_wm_region(C);
+ wm_event_handler_ui_cancel_ex(C, win, region, true);
+}
+
/** \} */
/* -------------------------------------------------------------------- */
@@ -1365,7 +1373,7 @@ static int wm_operator_invoke(bContext *C,
* while dragging the view or worse, that stay there permanently
* after the modal operator has swallowed all events and passed
* none to the UI handler */
- wm_handler_ui_cancel(C);
+ wm_event_handler_ui_cancel(C);
}
else {
WM_operator_free(op);
diff --git a/source/blender/windowmanager/wm_event_system.h b/source/blender/windowmanager/wm_event_system.h
index ffa5baae9f1..efcf40d03eb 100644
--- a/source/blender/windowmanager/wm_event_system.h
+++ b/source/blender/windowmanager/wm_event_system.h
@@ -149,6 +149,11 @@ void wm_event_do_depsgraph(bContext *C, bool is_after_open_file);
void wm_event_do_refresh_wm_and_depsgraph(bContext *C);
void wm_event_do_notifiers(bContext *C);
+void wm_event_handler_ui_cancel_ex(bContext *C,
+ wmWindow *win,
+ ARegion *region,
+ bool reactivate_button);
+
/* wm_event_query.c */
float wm_pressure_curve(float raw_pressure);
void wm_tablet_data_from_ghost(const struct GHOST_TabletData *tablet_data, wmTabletData *wmtab);
diff --git a/source/blender/windowmanager/wm_event_types.h b/source/blender/windowmanager/wm_event_types.h
index f16056cc91e..ffed86abfe7 100644
--- a/source/blender/windowmanager/wm_event_types.h
+++ b/source/blender/windowmanager/wm_event_types.h
@@ -333,6 +333,7 @@ enum {
EVT_BUT_OPEN = 0x5021, /* 20513 */
EVT_MODAL_MAP = 0x5022, /* 20514 */
EVT_DROP = 0x5023, /* 20515 */
+ /* When value is 0, re-activate, when 1, don't re-activate the button under the cursor. */
EVT_BUT_CANCEL = 0x5024, /* 20516 */
/* could become gizmo callback */