-
Notifications
You must be signed in to change notification settings - Fork 26
Expose allDesktops option from rc.xml in the desktop section #253
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
Open
jamieosullivan
wants to merge
1
commit into
lxqt:master
Choose a base branch
from
jamieosullivan:allDesktops
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -33,6 +33,9 @@ extern RrInstance* rrinst; // defined in obconf-qt.cpp | |
|
|
||
| static int num_desktops; | ||
|
|
||
| static const gchar* all_desktops_node_1 = "keyboard/keybind:key=A-Tab/action:name=NextWindow/allDesktops"; | ||
| static const gchar* all_desktops_node_2 = "keyboard/keybind:key=A-S-Tab/action:name=PreviousWindow/allDesktops"; | ||
|
|
||
| /* | ||
| static void desktops_read_names(); | ||
| static void desktops_write_names(); | ||
|
|
@@ -52,6 +55,9 @@ void MainDialog::desktops_setup_tab() { | |
| i = tree_get_int("desktops/popupTime", 875); | ||
| ui.desktop_popup->setChecked(i != 0); | ||
| ui.desktop_popup_time->setValue(i ? i : 875); | ||
|
|
||
| gboolean all_desktops = tree_get_bool(all_desktops_node_1, TRUE); | ||
| ui.all_desktops->setChecked(all_desktops); | ||
| } | ||
|
|
||
| void MainDialog::on_desktop_num_valueChanged(int newValue) { | ||
|
|
@@ -167,6 +173,11 @@ void MainDialog::on_desktop_popup_toggled(bool checked) { | |
| tree_set_int("desktops/popupTime", 0); | ||
| } | ||
|
|
||
| void MainDialog::on_all_desktops_toggled(bool checked) { | ||
| tree_set_bool(all_desktops_node_1, checked); | ||
| tree_set_bool(all_desktops_node_2, checked); | ||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I realise it's a little bit suboptimal having 2 calls to tree_apply() via these functions, maybe another function to avoid that is merited |
||
| } | ||
|
|
||
| void MainDialog::on_desktop_popup_time_valueChanged(int newValue) { | ||
| tree_set_int("desktops/popupTime", newValue); | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These long names are a bit ungainly and potentially fragile because of where the
allDesktopsentries are nested in the xml.Ideally (IMO)
allDesktopswould be broken out of the keybinds to some more convenient and stable location, as the behaviour seems independent of them to me, but Openbox seems to be mature and unchanged for a long time so I guess that's unlikely to happen. Doubtless there are a lot of programs out there using the current configurations that any change would break.Could maybe do something a bit more comprehensive here, like search the keybinds to see which ones have
<action name="[Next|Previous]Window">orallDesktopsand fill into a template string such as"keyboard/keybind:key=%s/action:name=%s/allDesktops"with ``g_strdup_printf`. Just means a bit more processing and code, and i'm conscious of introducing bugs.