Skip to content
Open
Show file tree
Hide file tree
Changes from 15 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
20 changes: 2 additions & 18 deletions src/Application.vala
Original file line number Diff line number Diff line change
Expand Up @@ -19,29 +19,13 @@
* Authored by: Felipe Escoto <[email protected]>
*/

public class Wallpaperize.Application : Granite.Application {
public const string PROGRAM_ID = "com.github.philip-scott.wallpaperize";
public class Wallpaperize.Application : Gtk.Application {
public const string PROGRAM_NAME = "Wallpaperize";

construct {
flags |= ApplicationFlags.HANDLES_OPEN;

application_id = PROGRAM_ID;
program_name = PROGRAM_NAME;
app_years = "2016-2017";
exec_name = PROGRAM_ID;
app_launcher = PROGRAM_ID;

build_version = "1.0";
app_icon = PROGRAM_ID;
main_url = "https://github.com/Philip-Scott/%s/".printf (PROGRAM_NAME);
bug_url = "https://github.com/Philip-Scott/%s/issues".printf (PROGRAM_NAME);
help_url = "https://github.com/Philip-Scott/%s/issues".printf (PROGRAM_NAME);
translate_url = "https://github.com/Philip-Scott/%s/tree/master/po".printf (PROGRAM_NAME);
about_authors = {"Felipe Escoto <[email protected]>", null};
about_translators = _("translator-credits");

about_license_type = Gtk.License.GPL_3_0;
application_id = "com.github.philip-scott.wallpaperize";
}

public override void open (File[] files, string hint) {
Expand Down
16 changes: 8 additions & 8 deletions src/Wallpaperize.vala
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ public class Wallpaperize.Wallpaperiser : Object {
}

public static void get_monitor_geometry() {
var screen = Gdk.Screen.get_default ();
int primary_monitor = screen.get_primary_monitor ();
Gdk.Rectangle geometry;
screen.get_monitor_geometry (primary_monitor, out geometry);

int monitor_scale = screen.get_monitor_scale_factor (primary_monitor);
Wallpaperize.Wallpaperiser.H = geometry.height * monitor_scale;
Wallpaperize.Wallpaperiser.W = geometry.width * monitor_scale;
var display = Gdk.Display.get_default ();
Gdk.Monitor monitor = display.get_primary_monitor ();
Gdk.Rectangle geometry = monitor.get_geometry ();

int scale_factor = monitor.get_scale_factor ();

Wallpaperize.Wallpaperiser.H = geometry.height * scale_factor;
Wallpaperize.Wallpaperiser.W = geometry.width * scale_factor;
}

public static void make_image (string input, string output) {
Expand Down