You are not logged in.

#1 2011-06-22 01:56:37

ren2r
Member
From: Bahia, Brasil
Registered: 2011-06-22
Posts: 25

[SOLVED] Drag gtk2 window by clicking menubar

Sorry my poor english, and if I made some mistake, this is my first post in one forum.
I have tried so much, but I can not find a answer for what I wanted.
In ubuntu we can drag window by clicking in empty space in menubar, is there a way of make this in arch? (for gtk2 apps)
maybe I'm not making in right way, but I read, that this was implemented in gtk2, so "would be" possible drag a window by menubar in arch too.

Last edited by ren2r (2011-06-24 03:56:18)


~/ren2r ...sorry for my bad english

Offline

#2 2011-06-22 03:43:23

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: [SOLVED] Drag gtk2 window by clicking menubar

I believe that hack is specific to the Equinox theme engine; I could be wrong, though.

Offline

#3 2011-06-22 03:59:47

ren2r
Member
From: Bahia, Brasil
Registered: 2011-06-22
Posts: 25

Re: [SOLVED] Drag gtk2 window by clicking menubar

Thanks for reply
I think It is not a hack in only Equinox engine, because this work with other themes like ambiance and radiance, and the condition for this work is a option "gktmenubar::window-dragging=1" in gtkrc file. It even works in a xterm session without a WM, allowing drag window by menu.
"this is a post where I found about it: https://bugzilla.gnome.org/show_bug.cgi?id=500437 ".

Last edited by ren2r (2011-06-22 04:07:36)


~/ren2r ...sorry for my bad english

Offline

#4 2011-06-24 03:49:53

ren2r
Member
From: Bahia, Brasil
Registered: 2011-06-22
Posts: 25

Re: [SOLVED] Drag gtk2 window by clicking menubar

I searched a bit more, and now I've got this working...
I downloaded the source of gtk2 and some patchs found on gnome bugzilla, and I created the package.
I will submit it for aur, but for now it's the PKGBUILD.

# Contributor: Rener Paiva <ren2r@mail.com> 
pkgname=gtk2-dragmenubar
pkgver=2.24.5
pkgrel=2
pkgdesc="The GTK+ Toolkit (v2) patched to support drag window by empty space in menubar and toolbars."
arch=('i686' 'x86_64')
url="http://www.gtk.org/"
makedepends=('atk' 'pango' 'libxcursor' 'libxinerama' 'libxrandr' 'libxi' 'libxcomposite' 'libxdamage' 'krb5' 'gnutls'
             'shared-mime-info' 'cairo' 'libcups' 'gdk-pixbuf2' 'gobject-introspection')
depends=('atk' 'pango' 'libxcursor' 'libxinerama' 'libxrandr' 'libxi' 'libxcomposite' 'libxdamage' 'krb5' 'gnutls' 'shared-mime-info' 'cairo' 'libcups' 'gtk-update-icon-cache')
provides=("gtk2=${pkgver}")
conflicts=('gtk2')
options=('!libtool' '!docs')
license=('LGPL')
install=gtk2.install

source=(http://ftp.gnome.org/pub/gnome/sources/gtk+/2.24/gtk+-${pkgver}.tar.xz
        xid-collision-debug.patch
        gdk_Make_background_changes_queue_a_repaint.patch
        drag_menubar_and_toolbar.patch)
sha256sums=('d6b30889efbb9fab9aa598092d08887826a7b2a3069b3bd5155dede28d9866f3'
            'd758bb93e59df15a4ea7732cf984d1c3c19dff67c94b957575efea132b8fe558'
            '3573af25e8db2fb490b264f80cb9e617ee1a36e767e36e7bb1d830c0b715db93'
            '5a13f6c401b12aff895e744afa05d3af07be6a1e7c5445a9b526804f43b94f4b')

build() {
    cd "${srcdir}/gtk+-${pkgver}"
    patch -Np1 -i "${srcdir}/xid-collision-debug.patch"
    patch -NRp1 -i "${srcdir}/gdk_Make_background_changes_queue_a_repaint.patch"
    patch -Np1 -i "${srcdir}/drag_menubar_and_toolbar.patch"

    CXX=/bin/false ./configure --prefix=/usr \
        --sysconfdir=/etc \
        --localstatedir=/var \
        --with-xinput=yes
    make
}
package() {

    backup=(etc/gtk-2.0/gtkrc)

    cd "${srcdir}/gtk+-${pkgver}"

    make DESTDIR="${pkgdir}" install
    sed -i "s#env python#env python2#" $pkgdir/usr/bin/gtk-builder-convert
    echo 'gtk-fallback-icon-theme = "gnome"' > "${pkgdir}/etc/gtk-2.0/gtkrc"
    #split this out to use with gtk3 too
    rm ${pkgdir}/usr/bin/gtk-update-icon-cache
}

and this is the patch:

http://bugzilla-attachments.gnome.org/attachment.cgi?id=155231

this is usefull for move gtk2 window without titlebars, or restore windows without title in gnome-shell...
if someone wanna test...

(updated with actual pkgbuild)

Last edited by ren2r (2011-07-11 03:30:21)


~/ren2r ...sorry for my bad english

Offline

#5 2011-06-24 04:48:45

ANOKNUSA
Member
Registered: 2010-10-22
Posts: 2,141

Re: [SOLVED] Drag gtk2 window by clicking menubar

Nice.  I'm an Awesome user, and drag windows using a modkey.  I did find the string you mention in the theme I currently use, but couldn't sort out how to get it workng through theme edititng alone.  To be clear: this is a DE/WM agnostic thing, right?  In any case, you seem like a born Archer.  I'm guessing you'll fit in quite well here. wink

Quick Edit:  I'd test it myself, but have my hands full with systemd right now (which I shouldn't be screwing around with anyway).  If it works for you with a vanilla Arch install, it's probably not terribly unstable, but a warning in the package description when you submit it to the AUR wouldn't be undue.

Last edited by ANOKNUSA (2011-06-24 04:51:56)

Offline

#6 2011-06-24 05:19:05

ren2r
Member
From: Bahia, Brasil
Registered: 2011-06-22
Posts: 25

Re: [SOLVED] Drag gtk2 window by clicking menubar

ANOKNUSA wrote:

Nice.  I'm an Awesome user, and drag windows using a modkey.  I did find the string you mention in the theme I currently use, but couldn't sort out how to get it workng through theme edititng alone.  To be clear: this is a DE/WM agnostic thing, right?  In any case, you seem like a born Archer.  I'm guessing you'll fit in quite well here. wink

Quick Edit:  I'd test it myself, but have my hands full with systemd right now (which I shouldn't be screwing around with anyway).  If it works for you with a vanilla Arch install, it's probably not terribly unstable, but a warning in the package description when you submit it to the AUR wouldn't be undue.

thanks again...
I'll still do some changes in PKGBUILD before post it in aur... thanks for the warn...
and what I tried say... in other distro like ubuntu, the string works, but no in arch... now I know, it's a patched gtk2 in their distributions.


~/ren2r ...sorry for my bad english

Offline

#7 2011-07-09 18:26:38

ren2r
Member
From: Bahia, Brasil
Registered: 2011-06-22
Posts: 25

Re: [SOLVED] Drag gtk2 window by clicking menubar

http://aur.archlinux.org/packages.php?ID=50589

This is the package, I've compiled and tested for a while and it works like I wanted and without issue.

"this two keys below make it work in a theme:
GtkMenuBar::window-dragging = 1 ## support to drag by menu
GtkWidget::window-dragging = 1 ## support to drag by toolbars

The first I saw in ubuntu themes, but the second I just tried and it worked, I never saw it before, but I think it works too in others like ubuntu."

Last edited by ren2r (2011-07-09 18:33:43)


~/ren2r ...sorry for my bad english

Offline

#8 2011-07-11 00:21:06

ScionicSpectre
Member
Registered: 2011-06-25
Posts: 98

Re: [SOLVED] Drag gtk2 window by clicking menubar

I wish more themes would include the toolbar, honestly. At least it's not very difficult to change- thank you so much for getting this on the AUR. big_smile

Offline

#9 2011-07-11 01:01:15

triplesquarednine
Member
Registered: 2011-04-12
Posts: 630

Re: [SOLVED] Drag gtk2 window by clicking menubar

i would also like to thank you for this. wink

the inconsistency between gtk3 and gtk2 menubar/toolbar dragging, was really annoying, and irritated me big time.

this is awesome.

cheerz

Offline

#10 2011-07-11 03:20:01

ren2r
Member
From: Bahia, Brasil
Registered: 2011-06-22
Posts: 25

Re: [SOLVED] Drag gtk2 window by clicking menubar

I would like see this in main gtk2 package of the extra repository, (for no need recompile the package again when it update and have to make a update manually) but I still do not know how contact the maintainer of packager gtk2 to ask if it can be done.
If someone knows how it can be done, it will be great. because this patch has discussed in gtk bug site, and I'm almost sure that is a official patch and wich it's the same applied in gtk3.


~/ren2r ...sorry for my bad english

Offline

#11 2011-07-11 03:26:15

ren2r
Member
From: Bahia, Brasil
Registered: 2011-06-22
Posts: 25

Re: [SOLVED] Drag gtk2 window by clicking menubar

ScionicSpectre wrote:

I wish more themes would include the toolbar, honestly. At least it's not very difficult to change- thank you so much for getting this on the AUR. big_smile

I really guess the option (for drag toolbar) is not much known, I've tried several themes and never saw it before.


~/ren2r ...sorry for my bad english

Offline

#12 2011-07-11 04:03:03

triplesquarednine
Member
Registered: 2011-04-12
Posts: 630

Re: [SOLVED] Drag gtk2 window by clicking menubar

ren2r wrote:

I would like see this in main gtk2 package of the extra repository, (for no need recompile the package again when it update and have to make a update manually) but I still do not know how contact the maintainer of packager gtk2 to ask if it can be done.
If someone knows how it can be done, it will be great. because this patch has discussed in gtk bug site, and I'm almost sure that is a official patch and wich it's the same applied in gtk3.

i think you may find, if you post your request in the 'AUR Issues, Discussion & PKGBUILD Requests' section of the Arch forums;

https://bbs.archlinux.org/viewforum.php?id=38

you will probably be able to get the maintainers attention. I just got CinePaint upgraded to the latest release by posting a request in there (CinePaint is also in /extra). i didn't expect a quick response and got one in the same day!  after explaining my position on why the package should be upgraded, within 36hours, there was an update for it pushed through smile

i also think this should patch should be added to gtk2. it's worthwhile, and allows Gtk3 and Gtk2 to be more seamless. Maybe you could also post a link in your request to the discussion in the gtk bug site.

who knows maybe the maintainer will agree...

cheerz

Last edited by triplesquarednine (2011-07-11 04:05:11)

Offline

Board footer

Powered by FluxBB