-
-
Notifications
You must be signed in to change notification settings - Fork 28
Port to GTK4 #295
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
Merged
Merged
Port to GTK4 #295
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
cabb09d
Bump deps
danirabbit efc605f
Merge branch 'master' into danirabbit/gtk4
danirabbit c24c8d9
Merge branch 'master' into danirabbit/gtk4
danirabbit 666e3e8
Merge branch 'master' into danirabbit/gtk4
danirabbit f811cf8
Merge branch 'master' into danirabbit/gtk4
danirabbit b0b7630
DisplayWidget: multipress → Click
danirabbit aac1ccc
Merge branch 'master' into danirabbit/gtk4
danirabbit 8e8707d
Comment out scroll events
danirabbit a4f11d3
provider for display
danirabbit dcbe7c7
Get close to able to compile
danirabbit f04f57d
Merge master
danirabbit ef67495
Fix bad merge
danirabbit 6fa8af1
CanberraGtk4
danirabbit d7f25e5
Bump to wingpanel 9
danirabbit 12b4682
Scroll controllers
danirabbit 8d67861
More scroll controller
danirabbit 6ea5056
Merge master
danirabbit 1a95639
Update style classes
danirabbit 337ebda
Remove image mask
danirabbit 35df3ae
Remove extra destroys
danirabbit c5687b3
Merge branch 'master' into danirabbit/gtk4
danirabbit bebde74
Fix device list hexpand
danirabbit ccbbfed
remove unused canberragtk dep
danirabbit 0f1615c
Remove canberragtk4 dep
danirabbit 837a1fa
Remove canberragtk4 dep from README
danirabbit 47e7445
See if this fixes compilation
danirabbit ff571c5
nope
danirabbit 07c07f9
Merge branch 'master' into danirabbit/gtk4
ryonakano 7c167bf
Fix build failing when defining signals with Gdk.ScrollEvent (#329)
ryonakano 47db698
Fix missing player controls (#331)
ryonakano 1bce5ff
Update meson.build
danirabbit eb3e527
Update src/CanberraGtk4.vala
danirabbit 32e2b4b
README: Update dependencies
ryonakano 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
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
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,82 @@ | ||
| /* | ||
| * Copyright 2022 elementary, Inc. (https://elementary.io) | ||
| * SPDX-License-Identifier: GPL-3.0-or-later | ||
| */ | ||
|
|
||
| /* code adapted from libcanberra */ | ||
|
|
||
| namespace CanberraGtk4 { | ||
| private Canberra.Context? context = null; | ||
|
|
||
| public unowned Canberra.Context? context_get () { | ||
| Canberra.Proplist proplist; | ||
|
|
||
| if (context != null) { | ||
| return context; | ||
| } | ||
|
|
||
| if (Canberra.Context.create (out context) != Canberra.SUCCESS) { | ||
| return null; | ||
| } | ||
|
|
||
| if (Canberra.Proplist.create (out proplist) != Canberra.SUCCESS) { | ||
| return null; | ||
| } | ||
|
|
||
| proplist.sets (Canberra.PROP_CANBERRA_XDG_THEME_NAME, Gtk.Settings.get_default ().gtk_sound_theme_name); | ||
|
|
||
| unowned var name = GLib.Environment.get_application_name (); | ||
| if (name != null) { | ||
| proplist.sets (Canberra.PROP_APPLICATION_NAME, name); | ||
| } else { | ||
| proplist.sets (Canberra.PROP_APPLICATION_NAME, "libcanberra-gtk"); | ||
| proplist.sets (Canberra.PROP_APPLICATION_VERSION, "%i.%i".printf (Canberra.MAJOR, Canberra.MINOR)); | ||
| proplist.sets (Canberra.PROP_APPLICATION_ID, "org.freedesktop.libcanberra.gtk"); | ||
| } | ||
|
|
||
| unowned var icon = Gtk.Window.get_default_icon_name (); | ||
| if (icon != null) { | ||
| proplist.sets (Canberra.PROP_APPLICATION_ICON_NAME, icon); | ||
| } | ||
|
|
||
| unowned var display = Gdk.Display.get_default (); | ||
| if (display is Gdk.X11.Display) { | ||
| unowned var display_name = display.get_name (); | ||
| if (display_name != null) { | ||
| proplist.sets (Canberra.PROP_WINDOW_X11_SCREEN, display_name); | ||
| } | ||
|
|
||
| var screen = "%i".printf (((Gdk.X11.Display) display).get_screen ().get_screen_number ()); | ||
| proplist.sets (Canberra.PROP_WINDOW_X11_SCREEN, screen); | ||
| } | ||
|
|
||
| context.change_props_full (proplist); | ||
|
|
||
| var val = Value (typeof (string)); | ||
| if (display.get_setting ("gtk-sound-theme-name", val)) { | ||
| context.change_props (Canberra.PROP_CANBERRA_XDG_THEME_NAME, val.get_string ()); | ||
| } | ||
|
|
||
| val = Value (typeof (bool)); | ||
| if (display.get_setting ("gtk-enable-event-sounds", val)) { | ||
| unowned var env = GLib.Environment.get_variable ("CANBERRA_FORCE_EVENT_SOUNDS"); | ||
| context.change_props (Canberra.PROP_CANBERRA_ENABLE, env != null ? true : val.get_boolean ()); | ||
| } | ||
|
|
||
| display.setting_changed.connect ((setting) => { | ||
| Value new_val; | ||
| if (setting == "gtk-sound-theme-name") { | ||
| new_val = Value (typeof (string)); | ||
| display.get_setting ("gtk-sound-theme-name", new_val); | ||
| context.change_props (Canberra.PROP_CANBERRA_ENABLE, new_val.get_string ()); | ||
| } else if (setting == "gtk-enable-event-sounds") { | ||
| new_val = Value (typeof (bool)); | ||
| unowned var env = GLib.Environment.get_variable ("CANBERRA_FORCE_EVENT_SOUNDS"); | ||
| display.get_setting ("gtk-enable-event-sounds", new_val); | ||
| context.change_props (Canberra.PROP_CANBERRA_ENABLE, env != null ? true : new_val.get_boolean ()); | ||
| } | ||
| }); | ||
|
|
||
| return context; | ||
| } | ||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.