Skip to content

Commit

Permalink
fix floating window z comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
Yatao Li committed Oct 17, 2021
1 parent b4be2e2 commit 4362d8a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion ViewModels/GridViewModel.fs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ and GridViewModel(_gridid: int, ?_parent: GridViewModel, ?_gridsize: GridSize) a
let mutable m_extmarks_oob = hashmap[] // tracks existing off-screen extmarks and last known position
let m_gridComparer = GridViewModel.MakeGridComparer() :> IComparer<GridViewModel>

static let mutable g_create_seq = 0
let m_create_seq = g_create_seq

let raiseInputEvent id e = m_input_ev.Trigger(id, e)

let getPos (p: Point) =
Expand Down Expand Up @@ -483,6 +486,7 @@ and GridViewModel(_gridid: int, ?_parent: GridViewModel, ?_gridsize: GridSize) a
fontConfig()
setCursorEnabled theme.cursor_enabled
clearBuffer false
g_create_seq <- g_create_seq + 1

this.Watch [

Expand Down Expand Up @@ -771,6 +775,7 @@ and GridViewModel(_gridid: int, ?_parent: GridViewModel, ?_gridsize: GridSize) a
member __.ExtWinClosed = m_ext_winclose_ev.Publish
member __.Parent with get() = m_parent and set(v) = m_parent <- v
member __.ZIndex with get() = m_z and set(v) = m_z <- v
member __.CreateSeq = m_create_seq
member __.SortChildren() =
m_child_grids.Sort(m_gridComparer)
member __.FindTargetVm r c =
Expand Down Expand Up @@ -827,7 +832,7 @@ and GridViewModel(_gridid: int, ?_parent: GridViewModel, ?_gridsize: GridSize) a
member __.Compare(x: GridViewModel, y: GridViewModel): int =
let dz = x.ZIndex - y.ZIndex
if dz = 0 then
y.GridId - x.GridId
y.CreateSeq - x.CreateSeq
else dz
}

Expand Down

0 comments on commit 4362d8a

Please sign in to comment.