-
Notifications
You must be signed in to change notification settings - Fork 49
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
Update virtual desktop Wine plugin (use Bean) #1073
Merged
Merged
Changes from 6 commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
abc2d55
Update script.js
Zemogiter 5550ad0
Update script.js
Zemogiter 234ebf0
Update script.js
Zemogiter a8c2b94
Update script.js
Zemogiter 2be9384
Add files via upload
Zemogiter c31e67f
Update application.json
Zemogiter 3781c3e
Update script.js
Zemogiter 34e2cbb
Update script.js
Zemogiter 66e6a80
Update script.js
Zemogiter 97716b0
Update script.js
Zemogiter 1169d54
Update script.js
Zemogiter 1d3fd5b
Update script.js
Zemogiter 903fcf8
Update script.js
Zemogiter f20ae8b
Update script.js
Zemogiter 928e664
Update script.js
Zemogiter 2f7fbdf
Update script.js
Zemogiter f036591
Update script.js
Zemogiter 1b68bc8
Update script.js
Zemogiter e82fced
Update script.js
Zemogiter 5748640
Update script.js
Zemogiter 73d2f81
Update script.js
Zemogiter 7271bfe
Update script.js
Zemogiter db69831
Update script.js
Zemogiter 755c035
Update script.js
Zemogiter 5a819b1
Merge branch 'master' into patch-4
Zemogiter ef28adc
Update script.js
Zemogiter 9910f44
Update script.js
Zemogiter 4329f07
Update script.js
Zemogiter 171df96
Update script.js
Zemogiter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"name" : "System Utils", | ||
"id" : "utils.functions.system", | ||
"description" : "Utils for system interaction." | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
var screenManager = Bean("screenManager"); | ||
Zemogiter marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
/** | ||
* obtains the width of user's screen | ||
Zemogiter marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* @returns {number} width of user's screen in pixels | ||
*/ | ||
|
||
function getScreenWidth() { | ||
Zemogiter marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return screenManager.getScreenWidth(); | ||
} | ||
|
||
/** | ||
* obtains the height of user's screen | ||
Zemogiter marked this conversation as resolved.
Show resolved
Hide resolved
|
||
* @returns {number} height of user's screen in pixels | ||
*/ | ||
|
||
function getScreenHeight() { | ||
Zemogiter marked this conversation as resolved.
Show resolved
Hide resolved
|
||
return screenManager.getScreenHeight(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"scriptName" : "virtual desktop", | ||
"id" : "utils.functions.system.virtual_desktop", | ||
"compatibleOperatingSystems" : [ | ||
"MACOSX", | ||
"LINUX" | ||
], | ||
"testingOperatingSystems" : [], | ||
"free" : true, | ||
"requiresPatch" : false | ||
} |
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.
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.
This check (and the height one afterwards) look strange to me. Normally I would expect a setter method like
setVirtualDesktop
to require a given parameter. If none is given it should fail with an error/exception.Therefore I think we should add an additional method:
@plata what do you think?
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.
@plata recommended it over
width == null
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.
My comment is not about the check itself. I think that it is a better idea to throw an error in the case that no width or height are given. I.e.:
I would like to hear @plata opinion about this :)
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.
But we are not giving screen height and width by default. Rather, the script extracts that info from the Bean. Therefore I think this solution would always throw the error.
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 is why I want to add an additional
autoSetVirtualDesktop
method that fetches width and height for you. The bigger question is: is it always the case thatsetVirtualDesktop
will be called without a width and height parameter or are there cases where the parameters are given? For example because a specific application requires a certain width and height?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.
I tried to test on Uplay script for Anno 2070 if giving screen dimensions would result in any undesireable outcome but every time I refres repos I get this error PhoenicisOrg/phoenicis#2036 (comment)
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.
I personally find that, using the screen width and height when nothing is provided in argument is an elegant way to do it. And since wine allows to set custom width and height for the virtual desktop, we should allow to do it also.