Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upUse a winres to give servo.exe an icon on Windows #11969
Conversation
highfive
commented
Jun 30, 2016
|
Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @wafflespeanut (or someone else) soon. |
waddlesplash
commented
Jun 30, 2016
|
Cc @metajack - this might help with adding a manifest via a resource file |
|
@waddlesplash Do you know why this code failed Travis? |
waddlesplash
commented
Jul 2, 2016
|
Yeah, it says so:
|
| fn windows_main() { | ||
| let out_dir = env::var("OUT_DIR").ok().expect("can't find out_dir"); | ||
|
|
||
| Command::new("windres").args(&["src/windows.rc", "-o"]) |
This comment has been minimized.
This comment has been minimized.
| MENUITEM "&New\tCtrl+N", MENU_NEW | ||
| MENUITEM "E&xit", MENU_EXIT | ||
| } | ||
| } |
This comment has been minimized.
This comment has been minimized.
|
@waddlesplash Thanks, I will look into this. |
waddlesplash
commented
Jul 2, 2016
•
|
Also ideally this should probably be combined with #11967 (as that one has the manifest & icon and this one does not) |
|
@waddlesplash I think it would be good to update #12125 also in that case |
waddlesplash
commented
Jul 2, 2016
|
erm... @metajack needs the branch so he can incorporate that code, no? |
|
@waddlesplash Do I rework the code? |
|
I am not sure why this second one failed... Error message is about python.
|
|
Try rebasing against master. |
|
|
@KiChjang I need to use another editor to fix the first tidy error and for the second: I have no idea what I need to do, I didn't think I had a license in the file. Thanks for posting. |
|
You can add the rc file to the list of ignored files in tidy.py. |
|
@jdm Thanks |
|
I think this is ready to go, but it needs a cherry-pick / rebase on top of the servo/servo master branch to remove all of the merge commits that have snuck in there. Let us know if you need some help with how to do that! Basically, the idea is that you need to create a new branch based on the master branch from servo/servo, use |
|
@Coder206 Ping? |
|
I am having trouble getting Servo to compile with Windows.
I am not sure where to go from here.... Any help is greatly appreciated! :) |
|
Many thanks @atouchet :) |
|
The code I pushed a moment ago is simply to provide an update to everyone on the status of the PR, I am able to compile but I am missing something to get the icon to show. Help and comments are greatly appreciated :) |
|
|
||
| fn windows_main() { | ||
| let mut res = winres::WindowsResource::new(); | ||
| res.set_resource_file("windows.rc"); |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Coder206
Apr 11, 2017
•
Author
Contributor
@UK992 Thanks for the suggestion, it would simplify the code a lot! :) However, only a corrupted version of the icon shows up in my taskbar...
Do you think this is a problem with winres?
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Coder206
Apr 11, 2017
•
Author
Contributor
When working on the code last night, I noticed there is a conflicting file setting the icon, it's support/windows/Servo.wxs.mako. After removing it, I did not encounter any corruption in the icon but the application icon on it's window is still missing like the above.
UPDATE: The above is true however, the icon is corrupted when I am using the winres crate.
|
I have been working on the code today with no success. What is creating the application window in Windows? It appears that there is some code in addition to support/windows/Servo.wxs.mako's two lines that specify the Here is the Notice the Command Prompt with the icon ^ Here is the |
retep998
commented
Apr 11, 2017
|
The icon specified in the resource file is used as the icon for the exe in windows explorer. To specify an icon for the window itself you have to load the icon and specify it in the window class that is registered and then used by the window. |
|
@retep998 It appears that /ports/glutin/windows.rs is taking care of this but after changing the icon path to |
retep998
commented
Apr 11, 2017
|
@Coder206 I can't find where |
|
@retep998 That's strange, the code seems to indicate that it's from |
|
Window icon on Windows is not implemented, there was an attempt on upstream repo (rust-windowing/glutin#688), but it's inactive for long time. |
|
|
|
@Coder206 Are you still working on this? |
|
Ok, closing for now. Thanks for trying anyway! I hope we'll get to have our fancy doge icon one day. :) |
Windows: Add icon to servo.exe Based on #11969 --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/20316) <!-- Reviewable:end -->
…2-icon); r=jdm Based on servo/servo#11969 --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors Source-Repo: https://github.com/servo/servo Source-Revision: 840c44e2a8db05c11d5c87a7ce644001732b0cfa --HG-- rename : servo/components/servo/servo.exe.manifest => servo/ports/servo/platform/windows/servo.exe.manifest extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : 595aeb4fc84adb07427d24b960e92b8bee6b7507
…2-icon); r=jdm Based on servo/servo#11969 --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors Source-Repo: https://github.com/servo/servo Source-Revision: 840c44e2a8db05c11d5c87a7ce644001732b0cfa UltraBlame original commit: e1d92ece90afece3b0151123135a1bbe7ad020b6
…2-icon); r=jdm Based on servo/servo#11969 --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors Source-Repo: https://github.com/servo/servo Source-Revision: 840c44e2a8db05c11d5c87a7ce644001732b0cfa UltraBlame original commit: e1d92ece90afece3b0151123135a1bbe7ad020b6
…2-icon); r=jdm Based on servo/servo#11969 --- - [x] `./mach build -d` does not report any errors - [x] `./mach test-tidy` does not report any errors Source-Repo: https://github.com/servo/servo Source-Revision: 840c44e2a8db05c11d5c87a7ce644001732b0cfa UltraBlame original commit: e1d92ece90afece3b0151123135a1bbe7ad020b6
Coder206 commentedJun 30, 2016
•
edited
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is