Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper multimonitor support #84

Merged
merged 11 commits into from
Jun 28, 2017
Merged

Proper multimonitor support #84

merged 11 commits into from
Jun 28, 2017

Conversation

patrick96
Copy link
Contributor

@patrick96 patrick96 commented Jun 25, 2017

Does brightness detection on a per monitor basis
Averages the brightness of the centers of all monitors to determine the colors
to pass to i3lock (color version)

Calculates the text width to determine the exact position so this should work
with any text

Speed wise, I was quite surprised:
On my desktop (dualmonitor) the old dualmonitor branch takes 4.48 seconds, the
master branch takes 2.5s and the code in this pull-request takes takes 2.9s to
lock

On my laptop (single screen) both this pull-request and the master branch take
1.8s

So the multimonitor functionality does not seem to add that much overhead for
single monitor systems

If this is satisfactory, I think it would solve the problems described in #10 and #70

Uses a new way to determine the brightness of the image, gives about the
same values as the old one, is less complex, and a little faster
The original screenshot is cut into pieces corresponding to the
different monitors and all the operations (including brightness
calculation) are done on those pieces individually

Right now this is extremely slow, a lot of it due to stitching together
at the end

is_dark has been removed because all it did was basically just compare
two numbers and set a different return value depending on which number
was bigger
Will be used later to properly center text relative to the monitor
Splitting and rejoining the images took way to long

Now we calculate the absolute positions of the locks and text instead of
using '-gravity Center' because the gravity option only makes sense if a
single monitor is in the image

We also only use a single convert call to apply all the effects and add
the icons and text to the image which should increase the speed
We again only use a single file so we just create a temp png file
Empty text would crash the get_text_width function
Since we again only have a single file to delete
@patrick96 patrick96 mentioned this pull request Jun 28, 2017
@AladW AladW merged commit 460619e into meskarune:master Jun 28, 2017
@AladW
Copy link
Collaborator

AladW commented Jun 28, 2017

Sorry, I accidentally merged this. I was looking at the man page one...

@patrick96
Copy link
Contributor Author

patrick96 commented Jun 28, 2017

No worries. I'll open another one

EDIT: New one: #87

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants