--- budgie-desktop-10.4+git20171031.10.g9f71bb8/src/panel/panel.vala 2017-10-31 15:13:59.000000000 +0000 +++ ../budgie-desktop-10.4+git20171031.10.g9f71bb8/src/panel/panel.vala 2019-06-05 09:28:24.561252999 +0100 @@ -247,6 +247,7 @@ applet_reparent(info); } if (repos) { + message("initial applet placement"); applet_reposition(info); } } @@ -522,8 +523,8 @@ for (int i = 0; i < applets.length; i++) { string? name = null; Budgie.AppletInfo? info = this.manager.load_applet_instance(applets[i], out name); - - if (info == null) { + + if (info == null || name == null) { /* Faiiiil */ if (name == null) { unowned List g = expected_uuids.find_custom(applets[i], GLib.strcmp); @@ -534,10 +535,12 @@ message("Unable to load invalid applet: %s", applets[i]); continue; } + message("pending applet %s", name); this.add_pending(applets[i], name); manager.modprobe(name); } else { /* um add this bro to the panel :o */ + message("Adding to panel %s", name); this.add_applet(info); } } @@ -651,9 +654,13 @@ continue; } - uuid = LibUUID.new(UUIDFlags.LOWER_CASE|UUIDFlags.TIME_SAFE_TYPE); - var id = config.get_string(appl, "ID").strip(); + if (!this.manager.is_extension_valid(id)) { + warning("Invalid plugin: %s", id); + continue; + } + + uuid = LibUUID.new(UUIDFlags.LOWER_CASE|UUIDFlags.TIME_SAFE_TYPE); if (uuid == null || uuid.strip() == "") { warning("Could not add new applet %s from config %s", id, name); continue; @@ -734,7 +741,7 @@ { unowned Gtk.Box? pack_target = null; Budgie.AppletInfo? initial_info = null; - + message("add applet"); initial_info = initial_config.lookup(info.uuid); if (initial_info != null) { info.alignment = initial_info.alignment; @@ -755,12 +762,15 @@ switch (info.alignment) { case "start": pack_target = start_box; + message("start"); break; case "end": pack_target = end_box; + message("end"); break; default: pack_target = center_box; + message("center"); break; } @@ -772,7 +782,9 @@ info.applet.panel_position_changed(this.position); pack_target.pack_start(info.applet, false, false, 0); - pack_target.child_set(info.applet, "position", info.position); + //pack_target.child_set(info.applet, "position", info.position); + pack_target.reorder_child(info.applet, info.position); + message("position %d", info.position); ulong id = info.notify.connect(applet_updated); info.set_data("notify_id", id); this.applet_added(info); @@ -808,27 +820,35 @@ if (new_parent == info.applet.get_parent()) { return; } + message("reparent %s", info.name); info.applet.reparent(new_parent); } void applet_reposition(Budgie.AppletInfo? info) { - info.applet.get_parent().child_set(info.applet, "position", info.position); + message("in applet_reposition %s %d", info.name, info.position); + var parent = info.applet.get_parent(); + parent.child_set(info.applet, "position", 0); + parent.child_set(info.applet, "position", info.position); + //parent.show_all(); } void applet_updated(Object o, ParamSpec p) { unowned AppletInfo? info = o as AppletInfo; - + message("in applet_updated"); /* Prevent a massive amount of resorting */ if (!this.is_fully_loaded) { + message("not fully loaded"); return; } if (p.name == "alignment") { applet_reparent(info); + message("reparent %s", info.name); } else if (p.name == "position") { applet_reposition(info); + message("reposition %s", info.name); } this.applets_changed(); } @@ -1262,6 +1282,7 @@ { unowned string key; unowned Budgie.AppletInfo? val; + message("reinforce_positions"); var iter = HashTableIter(applets); while (iter.next(out key, out val)) { @@ -1306,6 +1327,7 @@ uint len = new_parent.get_children().length(); info.alignment = new_home; info.position = (int)len; + applet_reparent(info); budge_em_left(old_home, 0); applets_changed(); } @@ -1330,9 +1352,23 @@ return; } if ((new_home = get_box_right(info)) != null) { + unowned Gtk.Box? new_parent = null; + switch (info.alignment) { + case "start": + new_parent = center_box; + break; + case "center": + new_parent = end_box; + break; + default: + new_parent = start_box; + break; + } + info.alignment = new_home; budge_em_right(new_home); info.position = 0; + applet_reparent(info); this.reinforce_positions(); applets_changed(); }