[Bf-blender-cvs] [f453df5] master: Fix T43128: Headerless panels are reorderable on Windows

julianeisel noreply at git.blender.org
Tue Jan 13 03:31:20 CET 2015


Commit: f453df5b0382a895edb23753a73b6d9b9cbea6ed
Author: julianeisel
Date:   Tue Jan 13 03:29:25 2015 +0100
Branches: master
https://developer.blender.org/rBf453df5b0382a895edb23753a73b6d9b9cbea6ed

Fix T43128: Headerless panels are reorderable on Windows

Seems like a weird issue, but to sort panels "qsort" is used, which works slightly different on Windows. So all I had
to do was cleaning up the logic in find_highest_panel so that headerless panels are sorted, but that it absolutly not
allows headerless panels to be above normal panels.
I made sure it works fine on Linux as well.

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

M	source/blender/editors/interface/interface_panel.c

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

diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index 5ccfa41..e68c8635 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -753,9 +753,13 @@ static int find_highest_panel(const void *a1, const void *a2)
 	const PanelSort *ps1 = a1, *ps2 = a2;
 	
 	/* stick uppermost header-less panels to the top of the region -
-	 * prevent them from being sorted */
-	if (ps1->pa->sortorder < ps2->pa->sortorder && ps1->pa->type->flag & PNL_NO_HEADER) return -1;
-	
+	 * prevent them from being sorted (multiple header-less panels have to be sorted though) */
+	if (ps1->pa->type->flag & PNL_NO_HEADER && ps2->pa->type->flag & PNL_NO_HEADER) {
+		/* skip and check for ofs and sortorder below */
+	}
+	else if (ps1->pa->type->flag & PNL_NO_HEADER) return -1;
+	else if (ps2->pa->type->flag & PNL_NO_HEADER) return 1;
+
 	if (ps1->pa->ofsy + ps1->pa->sizey < ps2->pa->ofsy + ps2->pa->sizey) return 1;
 	else if (ps1->pa->ofsy + ps1->pa->sizey > ps2->pa->ofsy + ps2->pa->sizey) return -1;
 	else if (ps1->pa->sortorder > ps2->pa->sortorder) return 1;




More information about the Bf-blender-cvs mailing list