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

Improvements to OpenVarioMenu #1214

Draft
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

Scumi
Copy link
Contributor

@Scumi Scumi commented May 9, 2023

Brief summary of the changes

Work-in-progress implementation update for the OpenVarioMenu.

Related issues and discussions

#1107
#1207
Openvario/meta-openvario#199

src/OV/System.hpp Outdated Show resolved Hide resolved
src/OV/System.cpp Outdated Show resolved Hide resolved
src/OV/System.hpp Outdated Show resolved Hide resolved
src/OV/System.cpp Outdated Show resolved Hide resolved
src/OV/System.cpp Outdated Show resolved Hide resolved
src/OV/System.hpp Outdated Show resolved Hide resolved
@Scumi Scumi force-pushed the improvement_OpenVarioMenu branch from 10288ad to cbdc07d Compare May 12, 2023 07:09
@MaxKellermann
Copy link
Contributor

src/OV/SystemDialog.cpp:111:28: error: lambda capture 'this' is not used [-Werror,-Wunused-lambda-capture]

@Scumi
Copy link
Contributor Author

Scumi commented May 12, 2023

src/OV/SystemDialog.cpp:111:28: error: lambda capture 'this' is not used [-Werror,-Wunused-lambda-capture]

Did not observe this during make build with gcc, but could re-produce with clang. Fixed.

@MaxKellermann
Copy link
Contributor

More compiler complaints:

In file included from ./src/io/BufferedOutputStream.hxx:11,
                 from src/OV/System.cpp:10:
In constructor ‘fmt::v9::format_int::format_int(int)’,
    inlined from ‘void OpenvarioSetRotation(DisplayOrientation)’ at src/OV/System.cpp:112:41:
/usr/include/fmt/format.h:3674:54: error: ‘rotation’ may be used uninitialized [-Werror=maybe-uninitialized]
 3674 |   explicit format_int(int value) : str_(format_signed(value)) {}
      |                                         ~~~~~~~~~~~~~^~~~~~~
src/OV/System.cpp: In function ‘void OpenvarioSetRotation(DisplayOrientation)’:
src/OV/System.cpp:92:7: note: ‘rotation’ was declared here
   92 |   int rotation;
      |       ^~~~~~~~

void
OpenvarioSetLanguage(const char* lang)
{
Run("localectl", "set-locale", lang);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you test this? Does this work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, not tested yet. I should've marked that commit as WIP as well. Was just an idea as a first shot without further looking into it. I can keep such things out of this Draft PR if it wastes your time looking at it.

OpenvarioSetLanguage(const char* lang)
{
Run("localectl", "set-locale", lang);
Run("export", fmt::format("LANG={}", lang).c_str());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has zero effect, even if this function call were able to invoke a shell built-in (which it does not). So you spawn a shell, use export to set an environment variable in this process, and then the process exits. The environment change is gone.

@Scumi
Copy link
Contributor Author

Scumi commented May 12, 2023

More compiler complaints:

[...]

May I ask what your compile command is?
I'm wondering why I do not see those compiler complaints.

Also you merged the rotation commit as is, right? I need to issue a fixup commit to have this variable initialized properly.

@Scumi Scumi force-pushed the improvement_OpenVarioMenu branch from 854cf71 to ef1a447 Compare May 15, 2023 15:12
Comment on lines +471 to +472
/*the x-menu is waiting a second to solve timing problem with display rotation */
std::this_thread::sleep_for(std::chrono::seconds(1));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds really horrible, and the justification for such a horrible kludge must be documented really well. Just saying "timing problem" isn't enough.

@MaxKellermann MaxKellermann added the needs-work this closed pull request requires some action to be merged label Feb 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-work this closed pull request requires some action to be merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants