! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
xfwm4 title button tweak
Status:
RESOLVED: MOVED
Severity:
enhancement

Comments

Description Keith 2012-04-17 12:38:17 CEST
It was suggested I put this here from the Xfce mailing lists.

As a themer coming from metacity the inability to set a vertical 
displacement  to the title bar buttons is annoying so I wrote this patch 
for xfwm4-4.9.1 ( in 4.10pre2 ) which adds a "button_vertical_offset" 
option to both the themerc and to xconf ( 
/general/button_vertical_offset in the xfwm4 channel ) this can be a 
positiive or negative offset to shift the buttons down or up 
respectively, any thoughts?

diff -crB src/frame.c patchfiles/frame.c
*** src/frame.c	2012-04-16 18:50:45.000000000 +0100
--- patchfiles/frame.c	2012-04-16 18:53:47.000000000 +0100
***************
*** 991,999 ****
                          xfwmWindowSetBG (&c->buttons[button], my_pixmap);
                      }
                      xfwmWindowShow (&c->buttons[button], x,
!                         (frameTop (c) - screen_info->buttons[button][state].height + 1) / 2,
                          screen_info->buttons[button][state].width,
!                         screen_info->buttons[button][state].height, TRUE);
                      button_x[button] = x;
                      x = x + screen_info->buttons[button][state].width +
                          screen_info->params->button_spacing;
--- 991,999 ----
                          xfwmWindowSetBG (&c->buttons[button], my_pixmap);
                      }
                      xfwmWindowShow (&c->buttons[button], x,
!                         ((frameTop (c) - screen_info->buttons[button][state].height + 1) / 2)+screen_info->params->button_vertical_offset,
                          screen_info->buttons[button][state].width,
!                         screen_info->buttons[button][state].height, TRUE);//KDH added button_vertical_offset
                      button_x[button] = x;
                      x = x + screen_info->buttons[button][state].width +
                          screen_info->params->button_spacing;
***************
*** 1028,1036 ****
                      x = x - screen_info->buttons[button][state].width -
                          screen_info->params->button_spacing;
                      xfwmWindowShow (&c->buttons[button], x,
!                         (frameTop (c) - screen_info->buttons[button][state].height + 1) / 2,
                          screen_info->buttons[button][state].width,
!                         screen_info->buttons[button][state].height, TRUE);
                      button_x[button] = x;
                  }
                  else
--- 1028,1036 ----
                      x = x - screen_info->buttons[button][state].width -
                          screen_info->params->button_spacing;
                      xfwmWindowShow (&c->buttons[button], x,
!                         ((frameTop (c) - screen_info->buttons[button][state].height + 1) / 2)+screen_info->params->button_vertical_offset,
                          screen_info->buttons[button][state].width,
!                         screen_info->buttons[button][state].height, TRUE);//KDH added button_vertical_offset
                      button_x[button] = x;
                  }
                  else

diff -crB src/settings.c patchfiles/settings.c
*** src/settings.c	2012-04-16 18:50:45.000000000 +0100
--- patchfiles/settings.c	2012-04-16 18:54:41.000000000 +0100
***************
*** 550,555 ****
--- 550,557 ----
      strncpy (screen_info->params->button_layout, getStringValue ("button_layout", rc), BUTTON_STRING_COUNT);
      screen_info->params->button_spacing = getIntValue ("button_spacing", rc);
      screen_info->params->button_offset = getIntValue ("button_offset", rc);
+     screen_info->params->button_vertical_offset = getIntValue ("button_vertical_offset", rc);//KDH added button_vertical_offset
+     
      screen_info->params->maximized_offset = getIntValue ("maximized_offset", rc);
      screen_info->params->title_vertical_offset_active =
          getIntValue ("title_vertical_offset_active", rc);
***************
*** 671,676 ****
--- 673,680 ----
          {"box_resize", NULL, G_TYPE_BOOLEAN, TRUE},
          {"button_layout", NULL, G_TYPE_STRING, TRUE},
          {"button_offset", NULL, G_TYPE_INT, TRUE},
+ //KDH added button_vertical_offset
+         {"button_vertical_offset", NULL, G_TYPE_INT, TRUE},
          {"button_spacing", NULL, G_TYPE_INT, TRUE},
          {"click_to_focus", NULL, G_TYPE_BOOLEAN, TRUE},
          {"focus_delay", NULL, G_TYPE_INT, TRUE},
***************
*** 1185,1190 ****
--- 1189,1196 ----
                  }
                  else if ((!strcmp (name, "button_offset"))
                        || (!strcmp (name, "button_spacing"))
+ //KDH added button_vertical_offset
+                       || (!strcmp (name, "button_vertical_offset"))
                        || (!strcmp (name, "double_click_time"))
                        || (!strcmp (name, "double_DOUBLE_CLICKclick_distance"))
                        || (!strcmp (name, "maximized_offset"))
diff -crB src/settings.h patchfiles/settings.h
*** src/settings.h	2012-04-16 18:50:45.000000000 +0100
--- patchfiles/settings.h	2012-04-16 18:54:53.000000000 +0100
***************
*** 173,178 ****
--- 173,180 ----
      int xfwm_margins[4];
      int activate_action;
      int button_offset;
+ //KDH added button_vertical_offset
+     int button_vertical_offset;
      int button_spacing;
      int double_click_action;
      guint easy_click;


probably don't have to tell you this but place the patch in the  top 
level of the xfwm4-4.9.1 folder run "patch  -p0 < xfwm4.patch" and 
configure;make install as usual.
Comment 1 Gabriel Potkány 2014-05-18 03:01:30 CEST
I, too would like to have this option integrated
Comment 2 Git Bot editbugs 2020-05-29 11:48:51 CEST
-- GitLab Migration Automatic Message --

This bug has been migrated to xfce.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.xfce.org/xfce/xfwm4/-/issues/72.

Please create an account or use an existing account on one of our supported OAuth providers. 

If you want to fork to submit patches and merge requests please continue reading here: https://docs.xfce.org/contribute/dev/git/start#gitlab_forks_and_merge_requests

Also feel free to reach out to us on the mailing list https://mail.xfce.org/mailman/listinfo/xfce4-dev

Bug #8714

Reported by:
Keith
Reported on: 2012-04-17
Last modified on: 2020-05-29

People

Assignee:
Olivier Fourdan
CC List:
1 user

Version

Attachments

Additional information