Re: [PATCH] remove borders on maximized windows
On Fri, Sep 18, 2009 at 11:52 PM, Marco Martin wrote: > now the config option is managed in Options, a bit better If the patch works how you want it to work it is fine to commit. -- Lucas Murray :: http://www.undefinedfire.com GPG Fingerprint: 0B88 499E 3F5B 1405 D952 258A AD90 B4F5 90B6 3534 ___ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel
Re: [PATCH] remove borders on maximized windows
On Friday 18 September 2009, Marco Martin wrote: > On Friday 18 September 2009, Marco Martin wrote: > > On Friday 18 September 2009, Lucas Murray wrote: > > > On Fri, Sep 18, 2009 at 2:31 AM, Marco Martin wrote: > > > > hi all, > > > > one of the things we need for the plasma netbook shell is to have > > > > windows fullscreen most of the time, so be maximized and without > > > > borders (title and controls to unmaximize and close are directly into > > > > the panel) but keeping the possibility to have not maximized windows > > > > with normal borders as usual. a while ago talking with martin we had > > > > the idea to use decoration, directly in kdecoration, so here it is.. > > > > > > This is not the correct way to go about it. You will want to use > > > fullscreen windows and not maximisation. No point hacking maximisation > > > to act identical to an already-existing functionality. > > > > > > > anoter idea could be modifying window rules to match also geometry, > > > > maximized state etc.. > > > > > > This is probably better. > > > > i tried expanding the window rules, but it seems that rules are stored > > per- client and only the ones that match, so a match of a thing that > > continuosly changes like the maximize state can't work. > > it could perhaps be solved by being able to access the client in > > WindowRules::check##rule and return a value that depends from the match, > > but doesn't seem particularly feasible? > > > > i think the best way is still in kcommondecoration (custom decoration > > would still be able to access the config option and manage it by > > temselves) > > > > another plasce could be in the Client class, in changeMaximize(), but > > doesn't seem to be possible to access the configuration from there? > > this is done in the Client class, the border should get actually destroyed > and recreated and is where the patch is smaller :) now the config option is managed in Options, a bit better > > > > another thing we need is to start windows always maximized, for that > > > > using a rule could be a good idea, however a problem is that we > > > > should maximize only windows with a decoration, because plasma popups > > > > are of window type (not dialog, yeah, bad, but kinda needed for drag > > > > and drop of extenders) > > > > > > KWin already has a "maximizing" placement algorithm. It can be enabled > > > in System Settings -> Window Behavior -> Advanced -> Placement. -- Marco Martin Index: options.h === --- options.h (revision 1023932) +++ options.h (working copy) @@ -310,6 +310,8 @@ */ bool electricBorderTiling() const { return electric_border_tiling; } +bool borderlessMaximizedWindows() const { return borderless_maximized_windows; } + bool topMenuEnabled() const { return topmenus; } bool desktopTopMenu() const { return desktop_topmenu; } @@ -376,6 +378,7 @@ int electric_border_pushback_pixels; bool electric_border_maximize; bool electric_border_tiling; +bool borderless_maximized_windows; bool show_geometry_tip; bool topmenus; bool desktop_topmenu; Index: options.cpp === --- options.cpp (revision 1023932) +++ options.cpp (working copy) @@ -193,6 +193,8 @@ config=KConfigGroup(_config,"Compositing"); refreshRate = config.readEntry( "RefreshRate", 0 ); +borderless_maximized_windows = config.readEntry( "BorderlessMaximizedWindows", false ); + // Read button tooltip animation effect from kdeglobals // Since we want to allow users to enable window decoration tooltips // and not kstyle tooltips and vise-versa, we don't read the Index: geometry.cpp === --- geometry.cpp (revision 1023932) +++ geometry.cpp (working copy) @@ -2218,6 +2218,9 @@ QRect clientArea = workspace()->clientArea( MaximizeArea, this ); +if( options->borderlessMaximizedWindows() ) +setNoBorder(max_mode == MaximizeFull); + // save sizes for restoring, if maximalizing if( !adjust && !( y() == clientArea.top() && height() == clientArea.height())) { ___ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel
Re: [PATCH] remove borders on maximized windows
On Friday 18 September 2009, Marco Martin wrote: > On Friday 18 September 2009, Lucas Murray wrote: > > On Fri, Sep 18, 2009 at 2:31 AM, Marco Martin wrote: > > > hi all, > > > one of the things we need for the plasma netbook shell is to have > > > windows fullscreen most of the time, so be maximized and without > > > borders (title and controls to unmaximize and close are directly into > > > the panel) but keeping the possibility to have not maximized windows > > > with normal borders as usual. a while ago talking with martin we had > > > the idea to use decoration, directly in kdecoration, so here it is.. > > > > This is not the correct way to go about it. You will want to use > > fullscreen windows and not maximisation. No point hacking maximisation > > to act identical to an already-existing functionality. > > > > > anoter idea could be modifying window rules to match also geometry, > > > maximized state etc.. > > > > This is probably better. > > i tried expanding the window rules, but it seems that rules are stored per- > client and only the ones that match, so a match of a thing that continuosly > changes like the maximize state can't work. > it could perhaps be solved by being able to access the client in > WindowRules::check##rule and return a value that depends from the match, > but doesn't seem particularly feasible? > > i think the best way is still in kcommondecoration (custom decoration > would still be able to access the config option and manage it by temselves) > > another plasce could be in the Client class, in changeMaximize(), but > doesn't seem to be possible to access the configuration from there? this is done in the Client class, the border should get actually destroyed and recreated and is where the patch is smaller :) > > > another thing we need is to start windows always maximized, for that > > > using a rule could be a good idea, however a problem is that we should > > > maximize only windows with a decoration, because plasma popups are of > > > window type (not dialog, yeah, bad, but kinda needed for drag and drop > > > of extenders) > > > > KWin already has a "maximizing" placement algorithm. It can be enabled > > in System Settings -> Window Behavior -> Advanced -> Placement. -- Marco Martin Index: client.cpp === --- client.cpp (revision 1023932) +++ client.cpp (working copy) @@ -180,6 +180,10 @@ ready_for_painting = false; // wait for first damage or sync reply #endif +KSharedConfigPtr c( KGlobal::config() ); +const KConfigGroup cg = c->group( "Windows" ); +borderlessMaximizedWindows = cg.readEntry( "BorderlessMaximizedWindows", false ); + // SELI TODO: Initialize xsizehints?? } Index: client.h === --- client.h (revision 1023932) +++ client.h (working copy) @@ -608,6 +608,7 @@ bool electricMaximizing; ElectricMaximizingMode electricMode; +bool borderlessMaximizedWindows; friend bool performTransiencyCheck(); }; Index: geometry.cpp === --- geometry.cpp (revision 1023932) +++ geometry.cpp (working copy) @@ -2218,6 +2218,9 @@ QRect clientArea = workspace()->clientArea( MaximizeArea, this ); +if( borderlessMaximizedWindows ) +setNoBorder(max_mode == MaximizeFull); + // save sizes for restoring, if maximalizing if( !adjust && !( y() == clientArea.top() && height() == clientArea.height())) { ___ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel
Re: [PATCH] remove borders on maximized windows
On Friday 18 September 2009, Lucas Murray wrote: > On Fri, Sep 18, 2009 at 2:31 AM, Marco Martin wrote: > > hi all, > > one of the things we need for the plasma netbook shell is to have windows > > fullscreen most of the time, so be maximized and without borders (title > > and controls to unmaximize and close are directly into the panel) but > > keeping the possibility to have not maximized windows with normal borders > > as usual. a while ago talking with martin we had the idea to use > > decoration, directly in kdecoration, so here it is.. > > This is not the correct way to go about it. You will want to use > fullscreen windows and not maximisation. No point hacking maximisation > to act identical to an already-existing functionality. > > > anoter idea could be modifying window rules to match also geometry, > > maximized state etc.. > > This is probably better. i tried expanding the window rules, but it seems that rules are stored per- client and only the ones that match, so a match of a thing that continuosly changes like the maximize state can't work. it could perhaps be solved by being able to access the client in WindowRules::check##rule and return a value that depends from the match, but doesn't seem particularly feasible? i think the best way is still in kcommondecoration (custom decoration would still be able to access the config option and manage it by temselves) another plasce could be in the Client class, in changeMaximize(), but doesn't seem to be possible to access the configuration from there? > > > another thing we need is to start windows always maximized, for that > > using a rule could be a good idea, however a problem is that we should > > maximize only windows with a decoration, because plasma popups are of > > window type (not dialog, yeah, bad, but kinda needed for drag and drop of > > extenders) > > KWin already has a "maximizing" placement algorithm. It can be enabled > in System Settings -> Window Behavior -> Advanced -> Placement. -- Marco Martin ___ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel
Re: [PATCH] remove borders on maximized windows
On Fri, Sep 18, 2009 at 5:47 PM, Marco Martin wrote: > uuh, so KDecoration::borders() should be no longer a pure virtual? If that's the only way to implement it then it cannot be done as all decorations override the function anyway. As some popular decorations use KDecoration directly there is no point changing KCommonDecoration as it defeats the purpose of having a global setting if only a few decorations actually obey it. -- Lucas Murray :: http://www.undefinedfire.com GPG Fingerprint: 0B88 499E 3F5B 1405 D952 258A AD90 B4F5 90B6 3534 ___ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel
Re: [PATCH] remove borders on maximized windows
On Friday 18 September 2009, Lucas Murray wrote: > On Fri, Sep 18, 2009 at 4:28 PM, Marco Martin wrote: > > well, exactly what is done in this patch, is just in the > > kcommondecoration superclass to no be specific to one single decoration. > > In that case: > > 1) The setting would be better called "borderlessMaximizedWindows". ok > 2) Layout metric calculation should force all sides to be 0 instead of > just the top. ok > 3) Apply the setting to KDecoration as well as not all decorations use > KCommonDecoration. uuh, so KDecoration::borders() should be no longer a pure virtual? Cheers, Marco Martin ___ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel
Re: [PATCH] remove borders on maximized windows
On Fri, Sep 18, 2009 at 4:28 PM, Marco Martin wrote: > well, exactly what is done in this patch, is just in the kcommondecoration > superclass to no be specific to one single decoration. In that case: 1) The setting would be better called "borderlessMaximizedWindows". 2) Layout metric calculation should force all sides to be 0 instead of just the top. 3) Apply the setting to KDecoration as well as not all decorations use KCommonDecoration. -- Lucas Murray :: http://www.undefinedfire.com GPG Fingerprint: 0B88 499E 3F5B 1405 D952 258A AD90 B4F5 90B6 3534 ___ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel
Re: [PATCH] remove borders on maximized windows
On Friday 18 September 2009, Lucas Murray wrote: > On Fri, Sep 18, 2009 at 9:11 AM, Lucas Murray wrote: > >> anoter idea could be modifying window rules to match also geometry, > >> maximized state etc.. > > > > This is probably better. > > Yet another idea is to just modify a decoration so that doesn't have a > title bar when maximised. well, exactly what is done in this patch, is just in the kcommondecoration superclass to no be specific to one single decoration. also, making them really fullscreen i have again the problem that they wants to go over non fullscreen windows and is it possible to make them with a border again from outside the application? (from a button in the panel) Cheers, Marco Martin ___ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel
Re: [PATCH] remove borders on maximized windows
On Friday 18 September 2009, Lucas Murray wrote: > On Fri, Sep 18, 2009 at 2:31 AM, Marco Martin wrote: > > hi all, > > one of the things we need for the plasma netbook shell is to have windows > > fullscreen most of the time, so be maximized and without borders (title > > and controls to unmaximize and close are directly into the panel) but > > keeping the possibility to have not maximized windows with normal borders > > as usual. a while ago talking with martin we had the idea to use > > decoration, directly in kdecoration, so here it is.. > > This is not the correct way to go about it. You will want to use > fullscreen windows and not maximisation. No point hacking maximisation > to act identical to an already-existing functionality. > > > anoter idea could be modifying window rules to match also geometry, > > maximized state etc.. > > This is probably better. > > > another thing we need is to start windows always maximized, for that > > using a rule could be a good idea, however a problem is that we should > > maximize only windows with a decoration, because plasma popups are of > > window type (not dialog, yeah, bad, but kinda needed for drag and drop of > > extenders) > > KWin already has a "maximizing" placement algorithm. It can be enabled > in System Settings -> Window Behavior -> Advanced -> Placement. excellent :) -- Marco Martin ___ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel
Re: [PATCH] remove borders on maximized windows
A Sexta, 18 de Setembro de 2009 02:14:09 Lucas Murray vocĂȘ escreveu: > On Fri, Sep 18, 2009 at 9:11 AM, Lucas Murray wrote: > >> anoter idea could be modifying window rules to match also geometry, > >> maximized state etc.. > > > > This is probably better. > > Yet another idea is to just modify a decoration so that doesn't have a > title bar when maximised. > i was thinking the same thing :) -- Oxygen coordinator ___ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel
Re: [PATCH] remove borders on maximized windows
On Fri, Sep 18, 2009 at 9:11 AM, Lucas Murray wrote: >> anoter idea could be modifying window rules to match also geometry, maximized >> state etc.. > > This is probably better. Yet another idea is to just modify a decoration so that doesn't have a title bar when maximised. -- Lucas Murray :: http://www.undefinedfire.com GPG Fingerprint: 0B88 499E 3F5B 1405 D952 258A AD90 B4F5 90B6 3534 ___ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel
Re: [PATCH] remove borders on maximized windows
On Fri, Sep 18, 2009 at 2:31 AM, Marco Martin wrote: > hi all, > one of the things we need for the plasma netbook shell is to have windows > fullscreen most of the time, so be maximized and without borders (title and > controls to unmaximize and close are directly into the panel) but keeping the > possibility to have not maximized windows with normal borders as usual. > a while ago talking with martin we had the idea to use decoration, directly in > kdecoration, so here it is.. This is not the correct way to go about it. You will want to use fullscreen windows and not maximisation. No point hacking maximisation to act identical to an already-existing functionality. > anoter idea could be modifying window rules to match also geometry, maximized > state etc.. This is probably better. > another thing we need is to start windows always maximized, for that using a > rule could be a good idea, however a problem is that we should maximize only > windows with a decoration, because plasma popups are of window type (not > dialog, yeah, bad, but kinda needed for drag and drop of extenders) KWin already has a "maximizing" placement algorithm. It can be enabled in System Settings -> Window Behavior -> Advanced -> Placement. -- Lucas Murray :: http://www.undefinedfire.com GPG Fingerprint: 0B88 499E 3F5B 1405 D952 258A AD90 B4F5 90B6 3534 ___ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel