Skip to content

Commit

Permalink
wm: As an experiment, remove all GTK+ code
Browse files Browse the repository at this point in the history
This should help us determine if GTK+ in the process is what is bricking
the WM under GNOME 3.24

Signed-off-by: Ikey Doherty <ikey@solus-project.com>
  • Loading branch information
ikeydoherty committed Apr 9, 2017
1 parent f277588 commit 0e8e937
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 83 deletions.
9 changes: 0 additions & 9 deletions src/wm/main.vala
Expand Up @@ -17,15 +17,6 @@ public static int main(string[] args)

ctx = Meta.get_option_context();

if ("--wayland" in args) {
warning("Running under Wayland, GTK+ functionality not available");
Budgie.BudgieWM.gtk_available = false;
Budgie.BudgieWM.wayland = true;
} else if (!Gtk.init_check(ref args)) {
warning("GTK+ functionality not available");
Budgie.BudgieWM.gtk_available = false;
}

try {
if (!ctx.parse(ref args)) {
return Meta.ExitCode.ERROR;
Expand Down
2 changes: 0 additions & 2 deletions src/wm/meson.build
Expand Up @@ -12,7 +12,6 @@ budgie_wm_sources = [
'keyboard.vala',
'main.vala',
'shim.vala',
'windowmenu.vala',
'wm.vala',
]

Expand Down Expand Up @@ -47,7 +46,6 @@ executable(
include_directories: extra_includes,
install: true,
vala_args: [
'--pkg', 'gtk+-3.0',
'--pkg', 'gio-unix-2.0',
'--pkg', 'ibus-1.0',
'--pkg', 'gnome-desktop-3.0',
Expand Down
72 changes: 0 additions & 72 deletions src/wm/wm.vala
Expand Up @@ -99,22 +99,18 @@ public class BudgieWM : Meta.Plugin
public static string[]? old_args;
public static bool wayland = false;

public static bool gtk_available = true;

static Clutter.Point PV_CENTER;
static Clutter.Point PV_NORM;

private Meta.BackgroundGroup? background_group;

private Gtk.Menu? menu = null;
private KeyboardManager? keyboard = null;

Settings? settings = null;
RavenRemote? raven_proxy = null;
ShellShim? shim = null;
BudgieWMDBUS? focus_interface = null;
PanelRemote? panel_proxy = null;
WindowMenu? winmenu = null;
LoginDRemote? logind_proxy = null;

private bool force_unredirect = false;
Expand Down Expand Up @@ -347,13 +343,6 @@ public class BudgieWM : Meta.Plugin
Meta.Prefs.override_preference_schema(MUTTER_MODAL_ATTACH, WM_SCHEMA);
Meta.Prefs.override_preference_schema(MUTTER_BUTTON_LAYOUT, WM_SCHEMA);

/* Follow GTK's policy on animations */
if (gtk_available) {
var settings = Gtk.Settings.get_default();
settings.bind_property("gtk-enable-animations", this, "use-animations");
winmenu = new WindowMenu();
}

settings = new Settings(WM_SCHEMA);
this.settings.changed.connect(this.on_wm_schema_changed);
this.on_wm_schema_changed(WM_FORCE_UNREDIRECT);
Expand Down Expand Up @@ -397,20 +386,6 @@ public class BudgieWM : Meta.Plugin
screen_group.show();
stage.show();

if (wayland && !gtk_available) {
unowned string[] args = BudgieWM.old_args;
if (Gtk.init_check(ref args)) {
BudgieWM.gtk_available = true;
message("Got GTK+ now");
} else {
message("Still no GTK+");
}
}

if (BudgieWM.gtk_available) {
init_menu();
}

keyboard = new KeyboardManager(this);
keyboard.hook_extra();
}
Expand Down Expand Up @@ -439,15 +414,6 @@ public class BudgieWM : Meta.Plugin
if (type != Meta.WindowMenuType.WM) {
return;
}

if (winmenu == null) {
return;
}
Timeout.add(100, ()=> {
winmenu.meta_window = window;
winmenu.popup(null, null, null, 3, Gdk.CURRENT_TIME);
return false;
});
}

/* Dismiss raven from view. Consider in future tracking the visible
Expand All @@ -460,24 +426,6 @@ public class BudgieWM : Meta.Plugin
}
}

bool on_button_release(Clutter.ButtonEvent? event)
{

if (event.button == 1) {
this.dismiss_raven();
} else if (event.button == 3 ) {
if (menu.get_visible()) {
menu.hide();
} else {
menu.popup(null, null, null, event.button, event.time);
}
} else {
return CLUTTER_EVENT_PROPAGATE;
}

return CLUTTER_EVENT_STOP;
}

void on_monitors_changed(Meta.Screen? screen)
{
background_group.destroy_all_children();
Expand Down Expand Up @@ -512,26 +460,6 @@ public class BudgieWM : Meta.Plugin
}
}

void init_menu()
{
menu = new Gtk.Menu();
menu.show();
var item = new Gtk.MenuItem.with_label(_("Change background"));
item.activate.connect(background_activate);
item.show();
menu.append(item);

var sep = new Gtk.SeparatorMenuItem();
sep.show();
menu.append(sep);

item = new Gtk.MenuItem.with_label(_("Settings"));
item.activate.connect(settings_activate);
item.show();
menu.append(item);

this.background_group.button_release_event.connect(on_button_release);
}

static const int MAP_TIMEOUT = 170;
static const int MENU_MAP_TIMEOUT = 120;
Expand Down

0 comments on commit 0e8e937

Please sign in to comment.