All of lore.kernel.org
 help / color / mirror / Atom feed
* Picture missing in About dialog on cocoa ui
@ 2021-07-07 17:00 Programmingkid
  2021-07-08  5:37 ` Akihiko Odaki
  0 siblings, 1 reply; 12+ messages in thread
From: Programmingkid @ 2021-07-07 17:00 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU devel list, Akihiko Odaki

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.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Picture missing in About dialog on cocoa ui
  2021-07-07 17:00 Picture missing in About dialog on cocoa ui Programmingkid
@ 2021-07-08  5:37 ` Akihiko Odaki
  2021-07-08  8:58   ` Peter Maydell
  2021-07-08 16:27   ` Programmingkid
  0 siblings, 2 replies; 12+ messages in thread
From: Akihiko Odaki @ 2021-07-08  5:37 UTC (permalink / raw)
  To: Programmingkid; +Cc: Peter Maydell, QEMU devel list

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

On Thu, Jul 8, 2021 at 2:00 AM Programmingkid <programmingkidx@gmail.com> wrote:
>
> 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.


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Picture missing in About dialog on cocoa ui
  2021-07-08  5:37 ` Akihiko Odaki
@ 2021-07-08  8:58   ` Peter Maydell
  2021-07-08 16:23     ` Programmingkid
  2021-07-08 16:27   ` Programmingkid
  1 sibling, 1 reply; 12+ messages in thread
From: Peter Maydell @ 2021-07-08  8:58 UTC (permalink / raw)
  To: Akihiko Odaki; +Cc: Programmingkid, QEMU devel list

On Thu, 8 Jul 2021 at 06:38, Akihiko Odaki <akihiko.odaki@gmail.com> wrote:
>
> 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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Picture missing in About dialog on cocoa ui
  2021-07-08  8:58   ` Peter Maydell
@ 2021-07-08 16:23     ` Programmingkid
  0 siblings, 0 replies; 12+ messages in thread
From: Programmingkid @ 2021-07-08 16:23 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU devel list, Akihiko Odaki



> On Jul 8, 2021, at 4:58 AM, Peter Maydell <peter.maydell@linaro.org> wrote:
> 
> On Thu, 8 Jul 2021 at 06:38, Akihiko Odaki <akihiko.odaki@gmail.com> wrote:
>> 
>> 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

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

Thank you.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Picture missing in About dialog on cocoa ui
  2021-07-08  5:37 ` Akihiko Odaki
  2021-07-08  8:58   ` Peter Maydell
@ 2021-07-08 16:27   ` Programmingkid
  2021-07-08 17:50     ` Peter Maydell
  1 sibling, 1 reply; 12+ messages in thread
From: Programmingkid @ 2021-07-08 16:27 UTC (permalink / raw)
  To: Akihiko Odaki; +Cc: Peter Maydell, QEMU devel list



> On Jul 8, 2021, at 1:37 AM, Akihiko Odaki <akihiko.odaki@gmail.com> wrote:
> 
> 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.

> 
> On Thu, Jul 8, 2021 at 2:00 AM Programmingkid <programmingkidx@gmail.com> wrote:
>> 
>> 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.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Picture missing in About dialog on cocoa ui
  2021-07-08 16:27   ` Programmingkid
@ 2021-07-08 17:50     ` Peter Maydell
  2021-07-08 18:38       ` Programmingkid
  2021-07-09  0:15       ` Akihiko Odaki
  0 siblings, 2 replies; 12+ messages in thread
From: Peter Maydell @ 2021-07-08 17:50 UTC (permalink / raw)
  To: Programmingkid; +Cc: QEMU devel list, Akihiko Odaki

On Thu, 8 Jul 2021 at 17:28, Programmingkid <programmingkidx@gmail.com> wrote:
> 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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Picture missing in About dialog on cocoa ui
  2021-07-08 17:50     ` Peter Maydell
@ 2021-07-08 18:38       ` Programmingkid
  2021-08-16 20:55         ` Programmingkid
  2021-07-09  0:15       ` Akihiko Odaki
  1 sibling, 1 reply; 12+ messages in thread
From: Programmingkid @ 2021-07-08 18:38 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU devel list, Akihiko Odaki



> On Jul 8, 2021, at 1:50 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
> 
> On Thu, 8 Jul 2021 at 17:28, Programmingkid <programmingkidx@gmail.com> wrote:
>> 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.

The picture did look nice in the About dialog.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Picture missing in About dialog on cocoa ui
  2021-07-08 17:50     ` Peter Maydell
  2021-07-08 18:38       ` Programmingkid
@ 2021-07-09  0:15       ` Akihiko Odaki
  2021-07-10  2:43         ` Programmingkid
  1 sibling, 1 reply; 12+ messages in thread
From: Akihiko Odaki @ 2021-07-09  0:15 UTC (permalink / raw)
  To: Peter Maydell; +Cc: Programmingkid, QEMU devel list

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


On Fri, Jul 9, 2021 at 2:51 AM Peter Maydell <peter.maydell@linaro.org> wrote:
>
> On Thu, 8 Jul 2021 at 17:28, Programmingkid <programmingkidx@gmail.com> wrote:
> > 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


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Picture missing in About dialog on cocoa ui
  2021-07-09  0:15       ` Akihiko Odaki
@ 2021-07-10  2:43         ` Programmingkid
  2021-07-10  3:30           ` Akihiko Odaki
  0 siblings, 1 reply; 12+ messages in thread
From: Programmingkid @ 2021-07-10  2:43 UTC (permalink / raw)
  To: Akihiko Odaki; +Cc: Peter Maydell, QEMU devel list



> On Jul 8, 2021, at 8:15 PM, Akihiko Odaki <akihiko.odaki@gmail.com> wrote:
> 
> 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.

> 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.


> See "[PATCH 1/4] cutils: Introduce bundle mechanism" for a general fix
> of the problem when loading a "bundled" file.
> 
> Regards,
> Akihiko Odaki
> 
> 
> On Fri, Jul 9, 2021 at 2:51 AM Peter Maydell <peter.maydell@linaro.org> wrote:
>> 
>> On Thu, 8 Jul 2021 at 17:28, Programmingkid <programmingkidx@gmail.com> wrote:
>>> 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



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Picture missing in About dialog on cocoa ui
  2021-07-10  2:43         ` Programmingkid
@ 2021-07-10  3:30           ` Akihiko Odaki
  0 siblings, 0 replies; 12+ messages in thread
From: Akihiko Odaki @ 2021-07-10  3:30 UTC (permalink / raw)
  To: Programmingkid, Peter Maydell, Paolo Bonzini; +Cc: QEMU devel list

On Sat, Jul 10, 2021 at 11:43 AM Programmingkid
<programmingkidx@gmail.com> wrote:
>
>
>
> > On Jul 8, 2021, at 8:15 PM, Akihiko Odaki <akihiko.odaki@gmail.com> wrote:
> >
> > 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.

> 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

>
> > 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.
>
>
> > See "[PATCH 1/4] cutils: Introduce bundle mechanism" for a general fix
> > of the problem when loading a "bundled" file.
> >
> > Regards,
> > Akihiko Odaki
> >
> >
> > On Fri, Jul 9, 2021 at 2:51 AM Peter Maydell <peter.maydell@linaro.org> wrote:
> >>
> >> On Thu, 8 Jul 2021 at 17:28, Programmingkid <programmingkidx@gmail.com> wrote:
> >>> 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
>


^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Picture missing in About dialog on cocoa ui
  2021-07-08 18:38       ` Programmingkid
@ 2021-08-16 20:55         ` Programmingkid
  2021-08-17  8:59           ` Peter Maydell
  0 siblings, 1 reply; 12+ messages in thread
From: Programmingkid @ 2021-08-16 20:55 UTC (permalink / raw)
  To: Peter Maydell; +Cc: QEMU devel list, Akihiko Odaki



> On Jul 8, 2021, at 2:38 PM, Programmingkid <programmingkidx@gmail.com> wrote:
> 
> 
> 
>> On Jul 8, 2021, at 1:50 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
>> 
>> On Thu, 8 Jul 2021 at 17:28, Programmingkid <programmingkidx@gmail.com> wrote:
>>> 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.



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: Picture missing in About dialog on cocoa ui
  2021-08-16 20:55         ` Programmingkid
@ 2021-08-17  8:59           ` Peter Maydell
  0 siblings, 0 replies; 12+ messages in thread
From: Peter Maydell @ 2021-08-17  8:59 UTC (permalink / raw)
  To: Programmingkid; +Cc: QEMU devel list, Akihiko Odaki

On Mon, 16 Aug 2021 at 21:55, Programmingkid <programmingkidx@gmail.com> wrote:
>
>
>
> > On Jul 8, 2021, at 2:38 PM, Programmingkid <programmingkidx@gmail.com> wrote:
> >
> >
> >
> >> On Jul 8, 2021, at 1:50 PM, Peter Maydell <peter.maydell@linaro.org> wrote:
> >>
> >> On Thu, 8 Jul 2021 at 17:28, Programmingkid <programmingkidx@gmail.com> wrote:
> >>> 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.

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

-- PMM


^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2021-08-17  9:01 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-07 17:00 Picture missing in About dialog on cocoa ui Programmingkid
2021-07-08  5:37 ` Akihiko Odaki
2021-07-08  8:58   ` Peter Maydell
2021-07-08 16:23     ` Programmingkid
2021-07-08 16:27   ` Programmingkid
2021-07-08 17:50     ` Peter Maydell
2021-07-08 18:38       ` Programmingkid
2021-08-16 20:55         ` Programmingkid
2021-08-17  8:59           ` Peter Maydell
2021-07-09  0:15       ` Akihiko Odaki
2021-07-10  2:43         ` Programmingkid
2021-07-10  3:30           ` Akihiko Odaki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.