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

Patched panel-profile.c to have multiple Xscreens work. #228

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 26 additions & 0 deletions mate-panel/panel-profile.c
Expand Up @@ -1392,13 +1392,15 @@ panel_profile_delete_object (AppletInfo *applet_info)

panel_profile_remove_from_list (type, id);
}
int screennum=0;

static void
panel_profile_load_object (char *id)
{
PanelObjectType object_type;
char *object_path;
char *toplevel_id;
char newtoplevel_id[14];
int position;
gboolean right_stick;
gboolean locked;
Expand All @@ -1410,9 +1412,33 @@ panel_profile_load_object (char *id)
object_type = g_settings_get_enum (settings, PANEL_OBJECT_TYPE_KEY);
position = g_settings_get_int (settings, PANEL_OBJECT_POSITION_KEY);
toplevel_id = g_settings_get_string (settings, PANEL_OBJECT_TOPLEVEL_ID_KEY);

right_stick = g_settings_get_boolean (settings, PANEL_OBJECT_PANEL_RIGHT_STICK_KEY);
locked = g_settings_get_boolean (settings, PANEL_OBJECT_LOCKED_KEY);

/* BEGIN This prevents all the panel items stacking N times on N X screen setups. */

strcpy(newtoplevel_id,toplevel_id);

if( ! strcmp(id,"menu-bar") ) {
/* We make the possibly wrong assumption that each screen only has one menu bar
This is how we know to increment the screen number. */
/*printf("MENU BAR toplevel_id=%s\t\t\tnewtoplevel_id=%s\t\tid=%s\t\tscreennum=%i\n",toplevel_id,newtoplevel_id,id,screennum);*/
++screennum;
}

if ( screennum >1 ) {
sprintf(newtoplevel_id,"-screen%i",screennum-1);
/* If the screen number is >1 then add -screen# to end of toplevel_id if it doesn't already have it */
if (strstr(toplevel_id,newtoplevel_id) == NULL) {
strcat(toplevel_id,newtoplevel_id);
}
}

/*printf("XXX toplevel_id=%s\t\t\tnewtoplevel_id=%s\t\tid=%s\t\tscreennum=%i\n",toplevel_id,newtoplevel_id,id,screennum);*/

/* END This prevents all the panel items stacking N times on N X screen setups. */

mate_panel_applet_queue_applet_to_load (id,
object_type,
toplevel_id,
Expand Down