Code Monkey home page Code Monkey logo

tseli0s / nvdialog Goto Github PK

View Code? Open in Web Editor NEW
45.0 45.0 2.0 1.04 MB

NvDialog is a C library that lets you create modal dialog boxes, file dialogs, notifications and other kinds of popups using the system's native API for user interfaces.

Home Page: https://tseli0s.github.io/nv.dialog

License: MIT License

CMake 4.85% C 90.81% Makefile 0.63% Shell 0.53% Objective-C 3.19%
c cpp cross-platform dialog dialog-box gtk gtk3 gui libadwaita library linux macos macosx objective-c win32 windows

nvdialog's People

Contributors

frityet avatar tseli0s avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nvdialog's Issues

[FEAT] Add sandboxing support (Flatpaks, UWP, ...) on NvDialog.

Most sandboxed environments such as Flatpak have specific restrictions that make a large part of NvDialog unusable (File dialogs, notifications, ...). The hardest part is that for each backend, we will have to manually implement it's own way of doing these.

The good part is that Windows has great backwards compatibility meaning UWP applications should behave the same under NvDialog as if they weren't sandboxed, except for hiding / denying access to some parts of the disk.

Flatpak on the other side requires DBus in order to ask for any sort of permission. If anybody is experienced enough, maybe they can implement it (And save some time) but most likely, we are gonna have to use Gtk's existing solutions for the file dialogs and let notification access up to the end user to determine.

This is a tracking issue, meaning that it tracks something that should be fixed or added in the future.

Specific NvDialog APIs will not succeed on macOS

During some internal rewrites for v0.8, macOS-specific code for NvDialog no longer compiled, leading to some calls being hardcoded to return NULL. There will be a patch release for v0.8 addressing exactly this.

[BUG] libnotify can't be `dlopen()`'ed on Debian-based distributions.

NvDialog opens libnotify (For notification support on Linux) using the dlopen call (Basically linking libnotify manually at runtime, here you can learn more). This helped decrease dependencies as one who did not desire notification support could just disable it. However, this means we must manually find the library.

For now, NvDialog hardcodes the expected path at /usr/lib/libnotify.so. However:

  • Debian, Ubuntu and derivatives use a different filesystem look than Arch and Void (Which is where this library used to be developed).
  • Sometimes the .so extension may be followed by the library version (NvDialog does this as well), however the hardcoded path won't be able to detect this.

So, here is my own solution:

  • Detect distribution at run time, and set path accordingly,
  • Use the set path of libnotify to load the library when needed,
  • And have a fallback path ready, in case the original one isn't found

(The issue is mostly fixed, we only have to make the backends use the new path)

MacOS X Support

MacOS X is the second most popular OS in the desktop market and not supporting it is sort of ironic. The two backends (Currently working to some degree) basically correspond to two platforms:

  • Gtk3 on Linux, which works seamlessly.
  • the Win32 API on Windows (+Wine), which also works fine although some functions take longer to be implemented.

For MacOS, we have two options:

  • Use Gtk there too, since Gtk is cross-platform or,
  • Use the native MacOS APIs, which I can't really do anything about since I don't have any Apple products and don't plan on buying any, hence someone will be in charge of doing this.

I am leaning towards the first because MacOS and Linux are pretty similar (both Unix-like) so it will save alot of time. However I've heard lots of horror stories when building Gtk so I'm still sceptical.

[BUG] Gtk causes segmentation faults.

When testing with winit and the Rust bindings to this library, it appears that Gtk causes a segmentation fault to the process by dereferencing an invalid pointer as a mutex. This unfortunately makes NvDialog impossible to use with winit, and largely defeats the purpose of a cross-platform library.

Currently this does not appear with GLFW on Linux, and other platforms do not have the same problem. Which easily pinpoints the issue to Gtk's windowing internals.

For the users of NvDialog, you are advised to temporarily stop using NvDialog until the issue is resolved or use another windowing library.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.