File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1009,7 +1009,7 @@ func (m *Manager) init() {
10091009 sigLoop := dbusutil .NewSignalLoop (bus , 10 )
10101010 sigLoop .Start ()
10111011 display .InitSignalExt (sigLoop , true )
1012-
1012+
10131013 err = display .Primary ().ConnectChanged (func (hasValue bool , primary string ) {
10141014 if ! hasValue {
10151015 return
@@ -1035,7 +1035,7 @@ func (m *Manager) init() {
10351035
10361036 // 保持主屏Rect和xsettings同步
10371037 if m .xSettingsGs .GetSchema ().HasKey (gsXSettingsPrimaryRect ) {
1038- oldRect := m .xSettingsGs .GetString (gsXSettingsPrimaryRect )
1038+ oldRect := m .xSettingsGs .GetString (gsXSettingsPrimaryRect )
10391039 if oldRect != rect2String (rect ) {
10401040 m .xSettingsGs .SetString (gsXSettingsPrimaryRect , rect2String (rect ))
10411041 }
@@ -1570,8 +1570,10 @@ func (m *Manager) handlePrimaryRectChanged(pmi *MonitorInfo) {
15701570 if (m .DisplayMode == DisplayModeMirror ) && (len (m .monitorMap ) > 1 ) && m .initPrimary {
15711571 return
15721572 }
1573- m .setPropPrimary (pmi .Name )
1574- m .setPropPrimaryRect (pmi .getRect ())
1573+ if pmi != nil {
1574+ m .setPropPrimary (pmi .Name )
1575+ m .setPropPrimaryRect (pmi .getRect ())
1576+ }
15751577}
15761578
15771579func (m * Manager ) setPrimary (name string ) error {
You can’t perform that action at this time.
0 commit comments