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

GTK4 #542

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

GTK4 #542

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/IndicatorManager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ public class Wingpanel.IndicatorManager : GLib.Object {
}

private void load (string path) {
warning ("LOAD: %s", path);
if (!Module.supported ()) {
error ("Wingpanel is not supported by this system!");
}
Expand Down Expand Up @@ -172,6 +173,7 @@ public class Wingpanel.IndicatorManager : GLib.Object {
void* function;

if (!module.symbol ("get_indicator", out function)) {
warning ("SYMBOL NOT FOUND");
return;
}

Expand All @@ -186,9 +188,10 @@ public class Wingpanel.IndicatorManager : GLib.Object {

if (indicator == null) {
debug ("Unknown plugin type for %s or indicator is hidden on this server!", path);

warning ("INDICATOR IS NULL");
return;
}
warning ("REGISTER");

module.make_resident ();
register_indicator (path, indicator);
Expand Down Expand Up @@ -327,7 +330,7 @@ public class Wingpanel.IndicatorManager : GLib.Object {
* @param indicator The indicator.
*/
public void register_indicator (string path, Wingpanel.Indicator indicator) {
debug ("%s registered", indicator.code_name);
warning ("%s registered", indicator.code_name);

var deregister_map = new Gee.HashMap<string, Wingpanel.Indicator> ();
indicators.@foreach ((entry) => {
Expand All @@ -347,6 +350,7 @@ public class Wingpanel.IndicatorManager : GLib.Object {
indicators.@set (path, indicator);

indicator_added (indicator);
warning ("INDICATOR ADDED");
}

/**
Expand Down
80 changes: 0 additions & 80 deletions lib/Widgets/Switch.vala

This file was deleted.

12 changes: 5 additions & 7 deletions lib/meson.build
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
indicators_dir = join_paths(get_option('prefix'), get_option('libdir'), 'wingpanel')
indicators_dir = join_paths(get_option('prefix'), get_option('libdir'), 'wingpanel-4')

config_vapi = meson.get_compiler('vala').find_library('config', dirs: meson.current_source_dir())

Expand All @@ -19,13 +19,11 @@ libwingpanel_deps = [
gtk_dep,
]

libwingpanel_lib = library('wingpanel',
libwingpanel_lib = library('wingpanel-4',
'Indicator.vala',
'IndicatorManager.vala',
'Widgets/Container.vala',
'Widgets/OverlayIcon.vala',
'Widgets/Separator.vala',
'Widgets/Switch.vala',
# 'Widgets/Container.vala',
# 'Widgets/OverlayIcon.vala',
config_header,
dependencies: [libwingpanel_deps, config_vapi],
vala_header: 'wingpanel.h',
Expand All @@ -37,7 +35,7 @@ libwingpanel_lib = library('wingpanel',
pkg.generate(
libwingpanel_lib,
filebase: 'wingpanel',
name: 'Wingpanel',
name: 'Wingpanel-4',
description: 'Wingpanel Indicators API',
version: meson.project_version(),
subdirs: 'wingpanel',
Expand Down
2 changes: 1 addition & 1 deletion lib/wingpanel.deps
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
glib-2.0
gee-0.8
gmodule-2.0
gtk+-3.0
gtk4
9 changes: 5 additions & 4 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ glib_dep = dependency('glib-2.0', version: '>=2.32')
gio_dep = dependency('gio-2.0')
gio_unix_dep = dependency('gio-unix-2.0')
gmodule_dep = dependency('gmodule-2.0')
gdk_wl_dep = dependency('gdk-wayland-3.0')
gdk_wl_dep = dependency('gtk4-wayland')
# GDK X11 dep is for detecting whether we're on Wayland or not ONLY, we don't actually have
# a hard X11 dependency here
gdk_x11_dep = dependency('gdk-x11-3.0')
gtk_dep = dependency('gtk+-3.0', version: '>=3.10')
# gdk_x11_dep = dependency('gdk-x11-3.0')
gtk_dep = dependency('gtk4')
gee_dep = dependency('gee-0.8')
granite_dep = dependency('granite', version: '>=5.4.0')
granite_dep = dependency('granite-7')
posix_dep = meson.get_compiler('vala').find_library('posix')
wl_client_dep = dependency('wayland-client')

Expand All @@ -46,6 +46,7 @@ subdir('src')
subdir('wingpanel-interface')
if get_option('example')
subdir('sample')
subdir('sample copy')
endif
subdir('po')
vapigen = find_program('vapigen', required: false)
Expand Down
12 changes: 9 additions & 3 deletions sample/SampleIndicator.vala
Original file line number Diff line number Diff line change
Expand Up @@ -47,16 +47,22 @@ public class Sample.Indicator : Wingpanel.Indicator {

/* Create a new composited icon */
display_widget = new Gtk.Overlay ();
display_widget.add (main_image);
display_widget.set_child (main_image);
display_widget.add_overlay (overlay_image);

var scroll = new Gtk.EventControllerScroll (NONE);
main_image.add_controller (scroll);
scroll.scroll.connect (() => {
warning ("SCROLL");
});

var separator = new Gtk.Separator (Gtk.Orientation.HORIZONTAL) {
margin_top = 3,
margin_bottom = 3
};

var hide_button = new Gtk.ModelButton ();
hide_button.text = _("Hide me!");
var hide_button = new Gtk.Button ();
hide_button.label = _("Hide me!");

var compositing_switch = new Granite.SwitchModelButton (_("Composited Icon"));

Expand Down
2 changes: 1 addition & 1 deletion src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ public class Wingpanel.Application : Gtk.Application {
base.startup ();

panel_window = new PanelWindow (this);
panel_window.show_all ();
panel_window.present ();

register_actions ();
}
Expand Down
Loading
Loading