[Bf-blender-cvs] [a37e889aebd] master: Fix T61013: changing top/status bar editor type can be changed with shortcut.

Brecht Van Lommel noreply at git.blender.org
Thu Jan 31 18:01:58 CET 2019


Commit: a37e889aebde18c130b1a9285219f03eed95a23d
Author: Brecht Van Lommel
Date:   Thu Jan 31 16:55:04 2019 +0100
Branches: master
https://developer.blender.org/rBa37e889aebde18c130b1a9285219f03eed95a23d

Fix T61013: changing top/status bar editor type can be changed with shortcut.

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

M	source/blender/editors/screen/screen_ops.c

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

diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 8736664d23c..325e69c2ea0 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -4705,6 +4705,12 @@ static void SCREEN_OT_region_blend(wmOperatorType *ot)
 /** \name Space Type Set or Cycle Operator
  * \{ */
 
+static bool space_type_set_or_cycle_poll(bContext *C)
+{
+	ScrArea *sa = CTX_wm_area(C);
+	return (sa && !ELEM(sa->spacetype, SPACE_TOPBAR, SPACE_STATUSBAR));
+}
+
 static int space_type_set_or_cycle_exec(bContext *C, wmOperator *op)
 {
 	const int space_type = RNA_enum_get(op->ptr, "space_type");
@@ -4753,7 +4759,7 @@ static void SCREEN_OT_space_type_set_or_cycle(wmOperatorType *ot)
 
 	/* api callbacks */
 	ot->exec = space_type_set_or_cycle_exec;
-	ot->poll = ED_operator_areaactive;
+	ot->poll = space_type_set_or_cycle_poll;
 
 	ot->flag = 0;



More information about the Bf-blender-cvs mailing list