Skip to content

Commit

Permalink
Merge pull request #1339 from cogentcore/monitors
Browse files Browse the repository at this point in the history
fixes for multi-monitor configurations.
  • Loading branch information
kkoreilly authored Nov 25, 2024
2 parents ef1e752 + 86af1b8 commit 6908afa
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
1 change: 1 addition & 0 deletions core/render.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ func (sc *Scene) applyStyleScene() {
// should be used by Widgets to rebuild things that are otherwise
// cached (e.g., Icon, TextCursor).
func (sc *Scene) doRebuild() {
sc.Stage.Sprites.Reset()
sc.updateScene()
sc.applyStyleScene()
sc.layoutRenderScene()
Expand Down
19 changes: 11 additions & 8 deletions core/renderwindow.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ func (w *renderWindow) resized() {
return
}
// w.FocusInactivate()
// w.InactivateAllSprites()
if !w.isVisible() {
rc.visible = false
if DebugSettings.WinEventTrace {
Expand Down Expand Up @@ -497,14 +496,18 @@ func (w *renderWindow) handleWindowEvents(e events.Event) {
w.gotFocus = false
w.sendWinFocusEvent(events.WinFocusLost)
case events.ScreenUpdate:
if DebugSettings.WinEventTrace {
fmt.Printf("Win: %v ScreenUpdate\n", w.name)
}
w.resized()
// TODO: figure out how to restore this stuff without breaking window size on mobile

// TheWindowGeometryaver.AbortSave() // anything just prior to this is sus
// if !system.TheApp.NoScreens() {
// Settings.UpdateAll()
// WindowGeometrySave.RestoreAll()
// }
if !TheApp.Platform().IsMobile() { // native desktop
// TheWindowGeometryaver.AbortSave() // anything just prior to this is sus
if TheApp.NScreens() > 0 {
AppearanceSettings.Apply()
UpdateAll()
// WindowGeometrySave.RestoreAll()
}
}
}
}
}
Expand Down
1 change: 1 addition & 0 deletions core/stages.go
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ func (sm *stages) resize(rg math32.Geom2DInt) {
for _, kv := range sm.stack.Order {
st := kv.Value
if st.Type == WindowStage || (st.Type == DialogStage && st.FullWindow) {
st.Sprites.reset()
st.Scene.resize(rg)
} else {
st.Scene.fitInWindow(rg)
Expand Down
2 changes: 1 addition & 1 deletion texteditor/editor.go
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@ func (ed *Editor) styleEditor() {
ed.Buffer.SetHighlighting(highlighting.StyleDefault)
}
}
ed.WidgetBase.Style()
ed.Frame.Style()
ed.CursorWidth.ToDots(&ed.Styles.UnitContext)
}

Expand Down

0 comments on commit 6908afa

Please sign in to comment.