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

OSD capability #657

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
8 changes: 1 addition & 7 deletions src/daemon/endsession.vala
Original file line number Diff line number Diff line change
Expand Up @@ -202,13 +202,7 @@ namespace Budgie {

unowned Gdk.Window? win = get_window();
if (win != null) {
Gdk.Display? display = screen.get_display();

if (display is Gdk.X11.Display) {
win.focus(((Gdk.X11.Display) display).get_user_time());
} else {
win.focus(Gtk.get_current_event_time());
}
win.focus(Gtk.get_current_event_time());
}
}

Expand Down
17 changes: 11 additions & 6 deletions src/daemon/manager.vala
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ namespace Budgie {
private LibSession.SessionClient? sclient;

/* On Screen Display */
public static unowned libxfce4windowing.Monitor? primary_monitor { get; private set; }
Budgie.OSDManager? osd;
Budgie.OSDKeys? osdkeys;
Budgie.Notifications.Server? notifications;
Budgie.StatusNotifier.FreedesktopWatcher? status_notifier;
Budgie.MenuManager? menus;
Budgie.TabSwitcher? switcher;
BudgieScr.ScreenshotServer? screenshotcontrol;
Budgie.XDGDirTracker? xdg_tracker;
Budgie.Background? background;
Expand All @@ -34,6 +34,9 @@ namespace Budgie {
* Construct a new ServiceManager and initialiase appropriately
*/
public ServiceManager(bool replace) {
libxfce4windowing.Screen.get_default().monitors_changed.connect(on_monitors_changed);
on_monitors_changed();

theme_manager = new Budgie.ThemeManager();
status_notifier = new Budgie.StatusNotifier.FreedesktopWatcher();
register_with_session.begin((o, res) => {
Expand All @@ -42,14 +45,13 @@ namespace Budgie {
message("Failed to register with Session manager");
}
});

osd = new Budgie.OSDManager();
osd.setup_dbus(replace);
osdkeys = new Budgie.OSDKeys();

notifications = new Budgie.Notifications.Server();
notifications.setup_dbus(replace);
menus = new Budgie.MenuManager();
menus.setup_dbus(replace);
switcher = new Budgie.TabSwitcher();
switcher.setup_dbus(replace);
background = new Budgie.Background();

try {
Expand All @@ -66,6 +68,9 @@ namespace Budgie {
screenlock.setup_dbus();
}

void on_monitors_changed() {
primary_monitor = libxfce4windowing.Screen.get_default().get_primary_monitor();
}
/**
* Attempt registration with the Session Manager
*/
Expand Down
152 changes: 0 additions & 152 deletions src/daemon/menus.vala

This file was deleted.

13 changes: 6 additions & 7 deletions src/daemon/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -32,26 +32,25 @@ daemon_sources = [
'statusnotifier.vala',
'main.vala',
'manager.vala',
'menus.vala',
'osd.vala',
'settings.vala',
'screenlock.vala',
'tabswitcher.vala',
'xdgdirtracker/dbus.vala',
'osdkeys.vala'
]

daemon_deps = [
dep_canberra,
dep_canberra_gtk3,
dep_giounix,
dep_gtk3,
dep_gdkx11,
dep_notify,
dep_gnomedesktop,
dep_wnck,
dep_xfce4windowing,
dep_gst,
dep_cairo,
gvc.get_variable('libgvc_dep'),
meson.get_compiler('c').find_library('m', required: false),
dep_upower,
link_libbudgieprivate,
libpanelplugin_vapi,
Expand Down Expand Up @@ -89,26 +88,26 @@ executable(
'--pkg', 'budgie-config',
'--pkg', 'gio-unix-2.0',
'--pkg', 'gtk+-3.0',
'--pkg', 'gdk-x11-3.0',
'--pkg', 'libxfce4windowing-0',
'--pkg', 'gvc-1.0',
# Make gresource work
'--target-glib=2.38',
'--gresources=' + gresource,
daemon_vala_args,
],
c_args: [
'-DWNCK_I_KNOW_THIS_IS_UNSTABLE',
'-DGNOME_DESKTOP_USE_UNSTABLE_API'
],
install: true,
install_rpath: rpath_libdir,
)

main_sources = [
'screenshot_main.vala',
]

ScreenshotMainDependencies = [
dependency('gtk+-3.0'),
dep_gtk3,
]

executable(
Expand Down
5 changes: 2 additions & 3 deletions src/daemon/notifications/dbus.vala
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,7 @@
GtkLayerShell.init_for_window(popup);
GtkLayerShell.set_layer(popup, GtkLayerShell.Layer.TOP);

var mon = libxfce4windowing.Screen.get_default().get_primary_monitor();
Gdk.Rectangle mon_rect = mon.get_workarea();
Gdk.Rectangle mon_rect = ServiceManager.primary_monitor.get_workarea();

ulong handler_id = 0;
handler_id = popup.get_child().size_allocate.connect((alloc) => {
Expand All @@ -375,7 +374,7 @@

/* determine the y position for the latest notification */
calculate_position(mon_rect.y);
GtkLayerShell.set_monitor(popup, mon.get_gdk_monitor());
GtkLayerShell.set_monitor(popup, ServiceManager.primary_monitor.get_gdk_monitor());
var pos = (NotificationPosition) this.panel_settings.get_enum("notification-position");
int edge_a, edge_b;

Expand Down
Loading