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

Rework monitors processing for desktop manager. #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all 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
7 changes: 7 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
Changes on 1.4.0 since 1.3.2:

* Reworked monitors processing for desktop manager. Monitor should remember
where it's plugged into config. When monitor is getting plugged off then
plugged on again, it will get remembered config back.


Changes on 1.3.2 since 1.3.1:

* Fixed case when some keyboard shortcuts stopped working: Alt+Home, Alt+Up.
Expand Down
11 changes: 10 additions & 1 deletion src/app-config.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* app-config.c
*
* Copyright 2010 PCMan <[email protected]>
* Copyright 2012-2014 Andriy Grytsenko (LStranger) <[email protected]>
* Copyright 2012-2021 Andriy Grytsenko (LStranger) <[email protected]>
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: I think you want 2012-2014, 2021 instead, because 2012-2021 would mean you've also touched the code in 2015, 2016, 2017, 2018, 2019, and 2020.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to use simple range, anyways I did it everywhere before so it's too late for such details now. :D

*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -643,6 +643,11 @@ void fm_app_config_load_desktop_config(GKeyFile *kf, const char *group, FmDeskto
g_free(cfg->folder);
cfg->folder = g_key_file_get_string(kf, group, "folder", NULL);

g_free(cfg->plug_name);
cfg->plug_name = g_key_file_get_string(kf, group, "plug_name", NULL);
g_free(cfg->model);
cfg->model = g_key_file_get_string(kf, group, "model", NULL);

fm_key_file_get_bool(kf, group, "show_wm_menu", &cfg->show_wm_menu);
_parse_sort(kf, group, &cfg->desktop_sort_type, &cfg->desktop_sort_by);
#if FM_CHECK_VERSION(1, 2, 0)
Expand Down Expand Up @@ -1063,6 +1068,10 @@ void fm_app_config_save_desktop_config(GString *buf, const char *group, FmDeskto
g_string_append_printf(buf, "desktop_font=%s\n", cfg->desktop_font);
if(cfg->folder)
g_string_append_printf(buf, "folder=%s\n", cfg->folder);
if(cfg->plug_name)
g_string_append_printf(buf, "plug_name=%s\n", cfg->plug_name);
if(cfg->model)
g_string_append_printf(buf, "model=%s\n", cfg->model);
g_string_append_printf(buf, "show_wm_menu=%d\n", cfg->show_wm_menu);
_save_sort(buf, cfg->desktop_sort_type, cfg->desktop_sort_by);
#if FM_CHECK_VERSION(1, 2, 0)
Expand Down
5 changes: 4 additions & 1 deletion src/app-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* app-config.h
*
* Copyright 2010 - 2011 PCMan <[email protected]>
* Copyright 2012-2014 Andriy Grytsenko (LStranger) <[email protected]>
* Copyright 2012-2021 Andriy Grytsenko (LStranger) <[email protected]>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -68,6 +68,7 @@ typedef struct _FmAppConfigClass FmAppConfigClass;

typedef struct
{
struct _FmDesktop* desktop; /* where it is used */
FmWallpaperMode wallpaper_mode;
char* wallpaper;
char** wallpapers;
Expand All @@ -80,6 +81,8 @@ typedef struct
GdkColor desktop_shadow;
char* desktop_font;
char *folder; /* NULL if default, empty if no icons, else path */
char* plug_name;
char* model; /* only available in GTK+3 */
gboolean show_wm_menu;
#if FM_CHECK_VERSION(1, 0, 2)
FmSortMode desktop_sort_type;
Expand Down
Loading