please help me implement Unity like features , undecorate window when maximized

Aaron Lewis the.warl0ck.1989 at gmail.com
Thu Nov 3 13:23:21 CET 2011


On 11:31 Thu 03 Nov     , Olivier Fourdan wrote:
> On Thu, Nov 3, 2011 at 10:30 AM, Aaron Lewis <the.warl0ck.1989 at gmail.com> wrote:
> > Hi,
> >        I wanted to hide window borders when it's maximized , so i
> >        downloaded xfwm4's source , and figured out my first station
> >        should be client.c
> >
> >        void clientToggleMaximized ()
> >
> >        But when i try to use gtk_window_set_decorated () to remove borders
> >        I got confused about which GtkWidget is should use ?
> >
> > //// in clientToggleMaximized:
> >        if ( restore_position )
> >        {
> >                gtk_window_set_decorated ( ?? , FALSE );
> >        }
> >        else
> >        {
> >                gtk_window_set_decorated ( ?? , TRUE );
> >        }
> > ////
> >
> >        I'll really appreciate it if any developers could tell a bit about
> >        the structure of XFWM4 , which saves my time ..
> 
> That's really not the way to do it, and this denotes some confusion
> about the role of the window manager.

You're right , i'm undecorating the WM itself.

> 
> If you want a quick a dirty solution, use "maximus" (also from
> Ubuntu), otherwise you'll have to change the window manager code
> appropriately (but not by trying to use gtk apps functions like that,
> this is for the applications, not the window manager).

Great , i modified its source , a quick patch is supplied here , if anyone need that ..
(So new window won't be maximized and undecorated on fresh start , only
when maximized)

========================================================================
diff -ur maximus-0.4.14/src/maximus-app.c maximus-0.4.14-my/src/maximus-app.c
--- maximus-0.4.14/src/maximus-app.c	2009-10-02 21:43:34.000000000 +0800
+++ maximus-0.4.14-my/src/maximus-app.c	2011-11-03 20:20:30.244125910 +0800
@@ -355,6 +355,10 @@
                   WnckWindow  *window,
                   MaximusApp *app)
 { 
+	g_signal_connect (window, "state-changed",
+			G_CALLBACK (on_window_state_changed), app);
+	return;
+
   MaximusAppPrivate *priv;
   WnckWindowType type;
   gint exclude = 0;
========================================================================

My journey will be finished for now , hope in the future XFWM could have an option for this
feature

Thanks for the tool !


-- 
Best Regards,
Aaron Lewis - PGP: 0xDFE6C29E ( http://pgp.mit.edu/ )
Finger Print: 9482 448F C7C3 896C 1DFE 7DD3 2492 A7D0 DFE6 C29E


More information about the Xfce4-dev mailing list