Skip to contentSkip to conversation

Picture missing in About dialog on cocoa ui

DISCUSSION Programmingkid 3 participants 12 messages Jul 7, 2021 – Aug 17, 2021

lore
Share & tools
lore
#0 lore raw

Hello, now that the code to add the icon to QEMU has been restored for Mac OS, I think it is time to revert patch e31746ecf8dd2f25f687c94ac14016a3ba5debfc. This patch was made to fix the missing icon in the About dialog but it doesn't seem to work any more. I do not see a picture in the About dialog on Mac OS 11.1. The easiest fix for this issue is to revert the mentioned patch. When I ran 'git revert e31746ecf8dd2f25f687c94ac14016a3ba5debfc' the picture in the About dialog appeared again.

#1 lore raw

Hi,

My installation correctly shows the picture. Please make sure you install it and run the installed binary (not the binary located in the build directory). The new code should work reliably once you install it while the old code may or may not work depending on how you execute the binary.

Regards,
Akihiko Odaki

Quoted 3 lines · Programmingkid

Hello, now that the code to add the icon to QEMU has been restored for Mac OS, I think it is time to revert patch e31746ecf8dd2f25f687c94ac14016a3ba5debfc. This patch was made to fix the missing icon in the About dialog but it doesn't seem to work any more. I do not see a picture in the About dialog on Mac OS 11.1. The easiest fix for this issue is to revert the mentioned patch. When I ran 'git revert e31746ecf8dd2f25f687c94ac14016a3ba5debfc' the picture in the About dialog appeared again.

#2 lore raw
Quoted 8 lines · Akihiko Odaki

Hi,

My installation correctly shows the picture. Please make sure you install it and run the installed binary (not the binary located in the build directory). The new code should work reliably once you install it while the old code may or may not work depending on how you execute the binary.

The correct behaviour would be for it to find the icon both as an installed binary and when run from the build directory. (This is true for various kinds of loaded file including guest bios images.)

thanks
-- PMM

#3 lore raw
Quoted 14 lines · Peter Maydell
Quoted 8 lines · Akihiko Odaki

Hi,

My installation correctly shows the picture. Please make sure you install it and run the installed binary (not the binary located in the build directory). The new code should work reliably once you install it while the old code may or may not work depending on how you execute the binary.

Quoted 7 lines

The correct behaviour would be for it to find the icon both as an installed binary and when run from the build directory. (This is true for various kinds of loaded file including guest bios images.)

thanks
-- PMM

Agreed. My original code did this. I do think reverting e31746ecf8dd2f25f687c94ac14016a3ba5debfc is the best way to fix this issue.

Thank you.

#4 lore raw
In reply to Akihiko Odaki
Quoted 14 lines · Akihiko Odaki

Hi,

My installation correctly shows the picture. Please make sure you install it and run the installed binary (not the binary located in the build directory). The new code should work reliably once you install it while the old code may or may not work depending on how you execute the binary.

Regards,
Akihiko Odaki

The problem with e31746ecf8dd2f25f687c94ac14016a3ba5debfc is it requires a picture file to be found in a certain path. My original code used QEMU's icon to obtain a picture. The reason why the picture in the About dialog stopped appearing was because of the move to the meson build system. A new patch has just been committed that fixes the missing icon issue. Using 'git revert e31746ecf8dd2f25f687c94ac14016a3ba5debfc' fixes the missing picture issue in the About dialog.

Thank you.

Quoted 5 lines · Programmingkid
Quoted 3 lines

Hello, now that the code to add the icon to QEMU has been restored for Mac OS, I think it is time to revert patch e31746ecf8dd2f25f687c94ac14016a3ba5debfc. This patch was made to fix the missing icon in the About dialog but it doesn't seem to work any more. I do not see a picture in the About dialog on Mac OS 11.1. The easiest fix for this issue is to revert the mentioned patch. When I ran 'git revert e31746ecf8dd2f25f687c94ac14016a3ba5debfc' the picture in the About dialog appeared again.

#5 lore raw
Quoted 7 lines · Programmingkid

The problem with e31746ecf8dd2f25f687c94ac14016a3ba5debfc is it requires a picture file to be found in a certain path. My original code used QEMU's icon to obtain a picture. The reason why the picture in the About dialog stopped appearing was because of the move to the meson build system. A new patch has just been committed that fixes the missing icon issue. Using 'git revert e31746ecf8dd2f25f687c94ac14016a3ba5debfc' fixes the missing picture issue in the About dialog.

If the icon is the same (same resolution, etc) then just using it does seem better than loading it off the filesystem. But we should also sort out why get_relocated_path() isn't working, because if QEMU. can't load files that way then other things will also be broken I think.

-- PMM

#6 lore raw
Quoted 13 lines · Peter Maydell
Quoted 7 lines · Programmingkid

The problem with e31746ecf8dd2f25f687c94ac14016a3ba5debfc is it requires a picture file to be found in a certain path. My original code used QEMU's icon to obtain a picture. The reason why the picture in the About dialog stopped appearing was because of the move to the meson build system. A new patch has just been committed that fixes the missing icon issue. Using 'git revert e31746ecf8dd2f25f687c94ac14016a3ba5debfc' fixes the missing picture issue in the About dialog.

Quoted 2 lines

If the icon is the same (same resolution, etc) then just using it does seem better than loading it off the filesystem.

The picture did look nice in the About dialog.

#7 lore raw
Quoted 8 lines · Programmingkid
Quoted 5 lines · Peter Maydell
Quoted 8 lines
Quoted 8 lines · Programmingkid
Quoted 7 lines

The problem with e31746ecf8dd2f25f687c94ac14016a3ba5debfc is it requires a picture file to be found in a certain path. My original code used QEMU's icon to obtain a picture. The reason why the picture in the About dialog stopped appearing was because of the move to the meson build system. A new patch has just been committed that fixes the missing icon issue. Using 'git revert e31746ecf8dd2f25f687c94ac14016a3ba5debfc' fixes the missing picture issue in the About dialog.

Hi Peter, I was wondering if you had made a decision on whether you plan on reverting the patch that breaks the About dialog for the Cocoa UI.

Thank you.

#8 lore raw
Quoted 19 lines · Programmingkid
Quoted 9 lines · Programmingkid
Quoted 5 lines · Peter Maydell
Quoted 8 lines
Quoted 8 lines · Programmingkid
Quoted 7 lines

The problem with e31746ecf8dd2f25f687c94ac14016a3ba5debfc is it requires a picture file to be found in a certain path. My original code used QEMU's icon to obtain a picture. The reason why the picture in the About dialog stopped appearing was because of the move to the meson build system. A new patch has just been committed that fixes the missing icon issue. Using 'git revert e31746ecf8dd2f25f687c94ac14016a3ba5debfc' fixes the missing picture issue in the About dialog.

Quoted 1 line

Hi Peter, I was wondering if you had made a decision on whether you plan on reverting the patch that breaks the About dialog for the Cocoa UI.

No, reverting looks like the wrong thing. If get_relocated_path() doesn't work then we should find and fix that bug.

-- PMM

#9 lore raw
In reply to Peter Maydell

I tried [NSApp applicationIconImage] but had no luck. I suspect it is because Rez is for Carbon development and deprecated while NSApp is from AppKit. Loading from the filesystem is inevitable.

By the way, I knew Rez is from Carbon but didn't know it is deprecated, which I have figured out just now by reading man. Reading the icon file and assigning it to [NSApp applicationIconImage] is a possible solution, but it requires modifications for all graphical backends (cocoa, gtk, and sdl) and of course an external icon file. Do you think removing the dependency on Rez is worth it?

See "[PATCH 1/4] cutils: Introduce bundle mechanism" for a general fix of the problem when loading a "bundled" file.

Regards,
Akihiko Odaki

Quoted 16 lines · Peter Maydell
Quoted 7 lines · Programmingkid

The problem with e31746ecf8dd2f25f687c94ac14016a3ba5debfc is it requires a picture file to be found in a certain path. My original code used QEMU's icon to obtain a picture. The reason why the picture in the About dialog stopped appearing was because of the move to the meson build system. A new patch has just been committed that fixes the missing icon issue. Using 'git revert e31746ecf8dd2f25f687c94ac14016a3ba5debfc' fixes the missing picture issue in the About dialog.

If the icon is the same (same resolution, etc) then just using it does seem better than loading it off the filesystem. But we should also sort out why get_relocated_path() isn't working, because if QEMU. can't load files that way then other things will also be broken I think.

-- PMM

#10 lore raw
Quoted 7 lines · Akihiko Odaki

I tried [NSApp applicationIconImage] but had no luck. I suspect it is because Rez is for Carbon development and deprecated while NSApp is from AppKit. Loading from the filesystem is inevitable.

Totally disagree. I'm on a new MacBook Air and the rez command is available. I will agree that Apple likes removing features but the rez command is not one of them.

I did not try [NSApp applicationIconImage], but I did try using [[NSWorkspace sharedWorkspace] iconForFile: program_path] and it worked.

Quoted 6 lines

By the way, I knew Rez is from Carbon but didn't know it is deprecated, which I have figured out just now by reading man. Reading the icon file and assigning it to [NSApp applicationIconImage] is a possible solution, but it requires modifications for all graphical backends (cocoa, gtk, and sdl) and of course an external icon file. Do you think removing the dependency on Rez is worth it?

I do not think we should remove any code that depends on rez. I honestly think the easiest and best thing to do is to go back to using my original patch for displaying a picture in the About dialog.

Quoted 24 lines

See "[PATCH 1/4] cutils: Introduce bundle mechanism" for a general fix of the problem when loading a "bundled" file.

Regards,
Akihiko Odaki

Quoted 16 lines · Peter Maydell
Quoted 7 lines · Programmingkid

The problem with e31746ecf8dd2f25f687c94ac14016a3ba5debfc is it requires a picture file to be found in a certain path. My original code used QEMU's icon to obtain a picture. The reason why the picture in the About dialog stopped appearing was because of the move to the meson build system. A new patch has just been committed that fixes the missing icon issue. Using 'git revert e31746ecf8dd2f25f687c94ac14016a3ba5debfc' fixes the missing picture issue in the About dialog.

If the icon is the same (same resolution, etc) then just using it does seem better than loading it off the filesystem. But we should also sort out why get_relocated_path() isn't working, because if QEMU. can't load files that way then other things will also be broken I think.

-- PMM

#11 lore raw
Quoted 10 lines · Programmingkid
Quoted 8 lines · Akihiko Odaki

I tried [NSApp applicationIconImage] but had no luck. I suspect it is because Rez is for Carbon development and deprecated while NSApp is from AppKit. Loading from the filesystem is inevitable.

Totally disagree. I'm on a new MacBook Air and the rez command is available. I will agree that Apple likes removing features but the rez command is not one of them.

I also think Apple is going to remove Rez anytime soon since the documentation also says it is deprecated since Xcode 6, which was released 2014. It is true that the manual says it's deprecated and Apple doesn't want us to use it but we can actually use it, of course.

I'd also like to hear opinions from maintainers. Peter, what do you think? I'm also adding Paolo Bonzini who merged the change introducing Rez.

Quoted 1 line

I did not try [NSApp applicationIconImage], but I did try using [[NSWorkspace sharedWorkspace] iconForFile: program_path] and it worked.

I meant it still needs filesystem access. Filesystem access is always a cause of headache. The problem in [[NSWorkspace sharedWorkspace]
iconForFile: program_path] I tried to address is also because of the filesystem. It constructs a path from argv and mainBundle but argv is not reliable to get the path of executable. Note that you still can get the executable path in a reliable manner with _NSGetExecutablePath(); a proper fix is to use the function if we opt to use the executable as the icon source.

Regards,
Akihiko Odaki

Quoted 36 lines
Quoted 7 lines

By the way, I knew Rez is from Carbon but didn't know it is deprecated, which I have figured out just now by reading man. Reading the icon file and assigning it to [NSApp applicationIconImage] is a possible solution, but it requires modifications for all graphical backends (cocoa, gtk, and sdl) and of course an external icon file. Do you think removing the dependency on Rez is worth it?

I do not think we should remove any code that depends on rez. I honestly think the easiest and best thing to do is to go back to using my original patch for displaying a picture in the About dialog.

Quoted 24 lines

See "[PATCH 1/4] cutils: Introduce bundle mechanism" for a general fix of the problem when loading a "bundled" file.

Regards,
Akihiko Odaki

Quoted 16 lines · Peter Maydell
Quoted 7 lines · Programmingkid

The problem with e31746ecf8dd2f25f687c94ac14016a3ba5debfc is it requires a picture file to be found in a certain path. My original code used QEMU's icon to obtain a picture. The reason why the picture in the About dialog stopped appearing was because of the move to the meson build system. A new patch has just been committed that fixes the missing icon issue. Using 'git revert e31746ecf8dd2f25f687c94ac14016a3ba5debfc' fixes the missing picture issue in the About dialog.

If the icon is the same (same resolution, etc) then just using it does seem better than loading it off the filesystem. But we should also sort out why get_relocated_path() isn't working, because if QEMU. can't load files that way then other things will also be broken I think.

-- PMM