Skip to content

Commit

Permalink
3.0.3 - Fix window resize slowness for real
Browse files Browse the repository at this point in the history
  • Loading branch information
Lains committed Apr 26, 2021
1 parent d02861c commit 2ad82a4
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 33 deletions.
10 changes: 0 additions & 10 deletions data/io.github.lainsce.Notejot.gschema.xml
Original file line number Diff line number Diff line change
@@ -1,15 +1,5 @@
<schemalist>
<schema id="io.github.lainsce.Notejot" path="/io/github/lainsce/Notejot/">
<key name="window-w" type="i">
<default>800</default>
<summary>Window geometry</summary>
<description>The width of window</description>
</key>
<key name="window-h" type="i">
<default>600</default>
<summary>Window geometry</summary>
<description>The height of window</description>
</key>
<key type="b" name="dark-mode">
<default>false</default>
<summary>Dark Mode</summary>
Expand Down
24 changes: 1 addition & 23 deletions src/MainWindow.vala
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ namespace Notejot {
// Etc
public bool pinned = false;
int uid = 0;
private uint update_idle_source = 0;

public GLib.ListStore notestore;
public GLib.ListStore trashstore;
Expand Down Expand Up @@ -268,9 +267,7 @@ namespace Notejot {
tm.load_from_file.begin ();
tm.load_from_file_nb.begin ();

listen_start ();

this.set_size_request (360, 280);
this.set_size_request (500, 500);
this.show ();
}

Expand All @@ -290,25 +287,6 @@ namespace Notejot {
return true;
}

public async void listen_start () {
if (update_idle_source > 0) {
GLib.Source.remove (update_idle_source);
}

update_idle_source = GLib.Idle.add (() => {
listen_to_changes ();
return false;
});
}

public bool listen_to_changes () {
Notejot.Application.gsettings.bind ("window-w", this, "default-width", GLib.SettingsBindFlags.DEFAULT);
Notejot.Application.gsettings.bind ("window-h", this, "default-height", GLib.SettingsBindFlags.DEFAULT);

update_idle_source = 0;
return GLib.Source.REMOVE;
}

// IO?
public Widgets.Note make_item (MainWindow win, GLib.Object item) {
lv.is_modified = true;
Expand Down

0 comments on commit 2ad82a4

Please sign in to comment.