Closed
Conversation
This is preparation for implementing action when monitor is added.
Because we want to remove / add FmDesktop pointers, using list instead of static array is easier to manage.
idle_config_save must be reset on fm_desktop_manager_finalize
Implement the action when the number of monitors may have changed as the funtion on_n_monitor_may_changed, which does: - check the number of the current monitors - check the number of monitors registered pcmanfm internal lists_desktop_per_screen[] variable - if the number of monitors actually increased, do - initialize and register new FmDesktop element - also show desktop icons Also g_signal_connent() screen pointer with on_n_monitor_may_changed function. To implement this, add a supplement function gdk_display_get_screen_num to get screen number from dpy and screen pointer.
In connect_model(), when fm_folder_model_new(folder, FALSE) is invoked, in libfm/src/gtk/fm-folder-model.c , * a new FmFolderModel object *model is created, * and fm_folder_model_set_folder(model, folder) is called internally. * When folder is already loaded, fm_folder_model_set_folder() calls _fm_folder_model_add_file() internally for each file in "Desktop" directory, which calls fm_folder_model_file_created(). * fm_folder_model_file_created() calls _fm_folder_model_insert_item(), and * _fm_folder_model_insert_item() calls gtk_tree_model_row_inserted() (for each file in "Desktop" directory), which emits "row-inserted" signal to the created model. What is the problem here is that this signal is needed for calling on_row_inserted() callback function (in pcmanfm/src/desktop.c), * which calls fm_folder_model_set_item_userdata(). * This fm_folder_model_set_item_userdata() call is needed for load_items(), as it tries to call the line: ``` item = fm_folder_model_get_item_userdata(desktop->model, &it); ``` and then it tries to access item->fi. So with current connect_model() implementation, when folder is already called, on_row_inserted callback function (for "row-inserted" signal) is never called. This causes fm_folder_model_get_item_userdata() return value (in load_itemr) NULL, and it makes segfault when accessing item->fi like https://bugzilla.redhat.com/show_bug.cgi?id=1827445 or so. So before setting folder for model by fm_folder_model_set_folder(), connecting model to signal from folder is needed beforehand.
Member
|
This seemed as an issue but I have to think it over again, something still seems odd. Let make it into 1.4.0 instead. |
Member
|
It seems all that numbering stuff became a complete mess when we come to plugged/unplugged monitors. |
Member
|
I've created a solution which should fix the problem without the mess with lists of lists. Will test it next week then will create a pull request for your review. Draft is here - code became cleaner a bit, some code dropped and not so much of code added. |
Author
|
I'm closing this in favor of the new solution |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes that when you enable another monitor while PCManFM's desktop manager is running, it will properly load the desktop for that monitor you just enabled.
These patches made by @mtasaka come from https://src.fedoraproject.org/rpms/pcmanfm/tree/master