Skip to content

Update gg.c.v screen_size function for Linux and BSD-derivatives #23146

Description

@Wajinn

Describe the feature

The screen_size function of gg.c.v is non-functional for Linux and BSD-derivative OSes. Suggest using similar code as done by islonely, which comes from Xlib.h (DefaultScreen(dpy)).

Example:

struct Size {
	int width, height;
};

struct Size screen_size() {
	Display *dpy = XOpenDisplay(0);
	int screen = DefaultScreen(dpy);
	struct Size sz = {
		DisplayWidth(dpy, screen),
		DisplayHeight(dpy, screen)
	};
	XCloseDisplay(dpy);
	return sz;
}

Use Case

Will give screen size for Linux and BSD-type OSes.

Proposed Solution

No response

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

Version used

V 0.4.8

Environment details (OS name and version, etc.)

Linux and BSD-derivatives

Note

You can use the 👍 reaction to increase the issue's priority for developers.

Please note that only the 👍 reaction to the issue itself counts as a vote.
Other reactions and those to comments will not be taken into account.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Feature/Enhancement RequestThis issue is made to request a feature or an enhancement to an existing one.Unit: gg/sokolA video, sound, rendering, or fonts related issue.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions