GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Virtual displays now use serial number as preferences ID appendix. by waydabber · Pull Request #793 · MonitorControl/MonitorControl

Conversation

@waydabber

@waydabber waydabber commented Nov 16, 2021

Copy link
Copy Markdown
Member

There was an issue regarding virtual displays (DisplayLink, Sidecar etc) - the app uses CGDirectDisplayID as a preference ID suffix alongside the display name and vendor/model number. Since on every connect this id is changing for these displays, MonitorControl could not track preferences associated to these displays (+ the preferences store was polluted with dead items as well). This is now fixed, we now use the system generated, permanent serial number as suffix for virtual displays. For real displays we continue to use CGDirectDisplayID as the serial number is often the same for identical displays which causes issues in multi-display configs with similar physical displays.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
waydabber added 6 commits November 14, 2021 23:10
@waydabber
Fixing Samsung 28E850 treated as a dummy.
8c1be5e
@waydabber
Removed OSD lock popup alltogether
a6e0402
@waydabber
Fix build number conflict
23ec024
@waydabber
Merge remote-tracking branch 'refs/remotes/origin/fixes'
45c769d
@waydabber
Virtual displays (Sidecar, DisplayLink etc) now use serial number ins…
635b998
…tead of CGDirectDisplayID for preferences storage appendix.
@waydabber
Merge remote-tracking branch 'refs/remotes/origin/fixes'
a2b27f8
@waydabber
waydabber requested review from JoniVR and the0neyouseek November 16, 2021 18:06
@waydabber waydabber assigned the0neyouseek, JoniVR and waydabber Nov 16, 2021
@waydabber

waydabber commented Nov 16, 2021

Copy link
Copy Markdown
Member Author

An other day, an other fix. Approve this one please. :) This is an addition to the bugfix release 4.0.2. Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@waydabber waydabber linked an issue Nov 16, 2021 that may be closed by this pull request
Saving display specific settings do not work on virtual displays #792
Closed
JoniVR
JoniVR reviewed Nov 16, 2021
View reviewed changes
Comment thread MonitorControl/Model/Display.swift Outdated
self.serialNumber = serialNumber
self.isVirtual = DEBUG_VIRTUAL ? true : isVirtual
self.isDummy = isDummy
self.prefsId = "(" + String(name.filter { !$0.isWhitespace }) + String(vendorNumber ?? 0) + String(modelNumber ?? 0) + "@" + (self.isVirtual ? String(self.serialNumber ?? 9999) : String(identifier)) + ")"

@JoniVR JoniVR Nov 16, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not use string concatenation here instead? I think that might simplify this line quite a bit.

I haven't really tested it myself, because I don't really know how the virtual display feature is supposed to work, but will this handle me changing the name of the display without issues? Or is this name property a different one from the one the user can configure?

I think something like:

self.prefsId = "(\(name.filter { !$0.isWhitespace })\(vendorNumber ?? 0)\(modelNumber ?? 0)@\(self.isVirtual ? (self.serialNumber ?? 9999) : identifier))"

might do the trick, is imo a bit more concise.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@waydabber waydabber Nov 16, 2021

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks nicer.

Yes, this name is a permanent one and different from friendlyName which was differentiated a while back.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@waydabber waydabber Nov 16, 2021

Copy link
Copy Markdown
Member Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed that line to look nice. Approve please! Thanks! :)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@waydabber
Made display pref id creation look nice.
c81c477
JoniVR
JoniVR approved these changes Nov 16, 2021
View reviewed changes
@waydabber
waydabber merged commit 226f068 into master Nov 16, 2021
@waydabber
waydabber deleted the fixes branch November 16, 2021 21:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@JoniVR JoniVR JoniVR approved these changes
@the0neyouseek the0neyouseek Awaiting requested review from the0neyouseek

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@the0neyouseek the0neyouseek

@JoniVR JoniVR

@waydabber waydabber

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Saving display specific settings do not work on virtual displays

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@waydabber @JoniVR @the0neyouseek
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.