Xfce Forum

Sub domains
 

You are not logged in.

#1 2017-04-08 23:29:44

guixxx
Member
Registered: 2017-04-08
Posts: 4

[SOLVED] How do I center the window title ignoring the action buttons?

Hey, first time XFCE user here. I'm loving it! As you can see from the screenshot below, the date plugin on xfce-panel is centered. The window title is centered too, but comparing eachother they're misaligned, why is that? I want to align the window title in the same way the panel does it, would that be possible? Thanks

NSsqk80.png


EDIT: Not sure if I worded the title correctly, english isn't my native language, sorry hmm

Last edited by guixxx (2017-04-09 16:26:19)

Offline

#2 2017-04-09 00:46:55

rufwoof
Member
Registered: 2017-04-06
Posts: 2

Re: [SOLVED] How do I center the window title ignoring the action buttons?

Hi guixxx

It's centralising between objects. Try for instance : Menu, settings, window manager, style ... and drag/drop a menu, shade and/or shade to the start of the Title ... and that will shift the centre of the Terminal title over a little. Or add something to the right hand side of the panel.

Offline

#3 2017-04-09 03:36:20

guixxx
Member
Registered: 2017-04-08
Posts: 4

Re: [SOLVED] How do I center the window title ignoring the action buttons?

Thanks for your suggestions, rufwoof. I've tried adding the three remaining buttons to the left side to compensate, but for some reason their size are different from the minimize/maximize/close buttons, so the title isn't still 100% centered. I've also tested all custom xfce themes to see if some of them would actually centralize the window title the way I wanted (completely ignoring buttons, just like Mac OS does it), but unfortunately none of them did.

Last edited by guixxx (2017-04-09 05:29:09)

Offline

#4 2017-04-09 16:24:14

guixxx
Member
Registered: 2017-04-08
Posts: 4

Re: [SOLVED] How do I center the window title ignoring the action buttons?

Good news! I've patched xfwm4 to behave the way I think looks better. I've made a PKGBUILD for Arch users:

# $Id$
# -------------
# Warning: This package was (poorly) patched to centralize window titles, ignoring any
# other object that a window may or may not have on the left or right side.
# BUGS? Hopefully none :D
# -------------
# Maintainer: Evangelos Foutras <evangelos@foutrelis.com>
# Contributor: tobias <tobias funnychar archlinux.org>

pkgname=xfwm4-patch
_pkgname=xfwm4
pkgver=4.12.4
pkgrel=1
pkgdesc="Xfce window manager"
arch=('i686' 'x86_64')
url="http://www.xfce.org/"
license=('GPL2')
groups=('xfce4')
depends=('libxfce4ui' 'libwnck' 'libdrm' 'hicolor-icon-theme')
makedepends=('intltool')
provides=('xfwm4')
conflicts=('xfwm4')
source=(http://archive.xfce.org/src/xfce/$_pkgname/${pkgver%.*}/$_pkgname-$pkgver.tar.bz2
        'centralize.patch')
sha256sums=('fa74048a75649a6e92df763a3cfb706d3fed1e1a6adf567f6693325a5a6efb36'
            'SKIP')

prepare() {
    cd "$srcdir/$_pkgname-$pkgver"
    patch -p0 -i "$srcdir/centralize.patch"
}

build() {
  cd "$srcdir/$_pkgname-$pkgver"

  ./configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --libexecdir=/usr/lib \
    --localstatedir=/var \
    --disable-static \
    --enable-startup-notification \
    --enable-randr \
    --enable-compositor \
    --enable-xsync \
    --disable-debug
  make
}

package() {
  cd "$srcdir/$_pkgname-$pkgver"
  make DESTDIR="$pkgdir" install
}

# vim:set ts=2 sw=2 et:

Create a file named centralize.patch in the same directory you have the PKGBUILD file and paste this:

--- src/frame.c	2016-02-24 07:42:32.000000000 -0300
+++ src/frame.c	2017-04-09 12:36:51.100556257 -0300
@@ -496,6 +496,8 @@
                 hoffset = w3 - logical_rect.width - screen_info->params->title_horizontal_offset;
                 break;
             case ALIGN_CENTER:
+                w5 += right;
+                w1 = (w5 / 2) - (w3 / 2) - w2;
                 hoffset = (w3 / 2) - (logical_rect.width / 2);
                 break;
         }
@@ -525,7 +527,7 @@
                 w1 = right - w2 - w3 - w4 - screen_info->params->title_horizontal_offset;
                 break;
             case ALIGN_CENTER:
-                w1 = left + ((right - left) / 2) - (w3 / 2) - w2;
+                w1 = (w5 / 2) - (w3 / 2) - w2;
                 break;
         }
         if (w1 < left)

To install, just run makepkg -si. To actually test it, you have to restart xfwm4. Press Alt-F2, type in xfwm4 --replace and press Enter. Your window titles will now be centralized ignoring any action button (like OSx does):

K2zMGXq.png

Last edited by guixxx (2017-04-09 16:39:54)

Offline

#5 2017-04-09 17:58:40

PaperNick
Member
Registered: 2013-05-26
Posts: 106

Re: [SOLVED] How do I center the window title ignoring the action buttons?

guixxx wrote:

Good news! I've patched xfwm4 to behave the way I think looks better. I've made a PKGBUILD for Arch users

That's awesome! I think you should open a pull request with this patch smile

Offline

#6 2017-04-10 18:02:03

guixxx
Member
Registered: 2017-04-08
Posts: 4

Re: [SOLVED] How do I center the window title ignoring the action buttons?

PaperNick wrote:
guixxx wrote:

Good news! I've patched xfwm4 to behave the way I think looks better. I've made a PKGBUILD for Arch users

That's awesome! I think you should open a pull request with this patch smile

Thanks! To be honest I don't know how to do that. Also, maybe the development team have a reason for not doing that? But you (or anyone else) can send them this patch on your name if you want, I don't care about credits. wink

Offline

Board footer

Powered by FluxBB