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

Set the Window Icon #27

Closed
slime73 opened this issue Jul 9, 2010 · 6 comments
Closed

Set the Window Icon #27

slime73 opened this issue Jul 9, 2010 · 6 comments
Labels
feature New feature or request

Comments

@slime73
Copy link
Member

slime73 commented Jul 9, 2010

Original report by Sean Donno (Bitbucket: [Sean Donnellan](https://bitbucket.org/Sean Donnellan), ).


This is a feature request for a way to set the icon on the window.

I propose love.graphics.setIcon( image )

Like SDL_WM_SetIcon in SDL.

Reason for it is makes identifying your LOVE game in Task Switcher (Alt+Tab) easier and nicer.

@slime73
Copy link
Member Author

slime73 commented Jul 9, 2010

Original comment by Robin Wellner (Bitbucket: gvx, GitHub: gvx).


Alternatively or additionally, perhaps a setting in conf.lua?

@slime73
Copy link
Member Author

slime73 commented Jul 11, 2010

Original comment by Bart van Strien (Bitbucket: bartbes, GitHub: bartbes).


@robin: in any case additionally.

Yeah, seems like a nice feature, if it's SDL it can't be too hard (can it?)

@slime73
Copy link
Member Author

slime73 commented Jul 12, 2010

Original comment by Bill Meltsner (Bitbucket: bmelts, GitHub: bmelts).


It's pretty simple: get the raw pixel data of an Image, create an SDL_Surface with it, and pass that to SDL_WM_SetIcon.

I'll take this one.

@slime73
Copy link
Member Author

slime73 commented Jul 12, 2010

Original comment by Sean Donno (Bitbucket: [Sean Donnellan](https://bitbucket.org/Sean Donnellan), ).


I managed to get some time today to have a look at trying to do it myself.

I was however not able to get it fully working, ran into some problems with the typing.
Incorrect parameter type: expected userdata.

I am sure that Creating a surface, setting an icon and then freeing the surface again is fine as the SetIcon will copy the image data, meaning it is safe to free as it is not being used.
For X11, the SetIcon function will XCreatePixmap and so forth thus duplication image data and the data is copied acorss. Similarly Windows does a similar thing CreateIconFromResourceEx, so that data stored b in the surface is not accessed by the WM after the SetIcon function call.

Sorry, for not being able to produce a fully working patch, but at the least I hope this can help as a base.

@slime73
Copy link
Member Author

slime73 commented Aug 1, 2010

Original comment by Bill Meltsner (Bitbucket: bmelts, GitHub: bmelts).


Implemented in <>.

@slime73 slime73 closed this as completed Aug 1, 2010
@slime73
Copy link
Member Author

slime73 commented Aug 1, 2010

Original comment by Robin Wellner (Bitbucket: gvx, GitHub: gvx).


Not a setting in conf.lua yet, is that on purpose?

@slime73 slime73 added major feature New feature or request labels Feb 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant