Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FvwmPager - DeskStyles #1013

Merged
merged 15 commits into from
Apr 17, 2024
Merged

FvwmPager - DeskStyles #1013

merged 15 commits into from
Apr 17, 2024

Conversation

somiaj
Copy link
Collaborator

@somiaj somiaj commented Apr 16, 2024

DeskStyles provide a more standardized way to apply settings to each desktop individually (which can be used both when viewing multiple desks or just viewing only the current active desk). This restructures how to configure setting mostly colorsets settings on a per desk basis. With this the colors of the desktop, active monitors, windows, focus windows, and balloon window can all be configured for individual desktops. This also uses a standardized format to configure all the different colorsets or colors.

# Set a colorset for all desks, both syntax's do the same thing.
*FvwmPager: Colorset 12
*FvwmPager: HilightColorset * 12

To set a configuration for a specific desk, let's say desk 2, provide the desk number as the first parameter.

# Set colorset for desk 2.
*FvwmPager: Colorset 2 14
*FvwmPager: HilightColorset 2 15

The FvwmPager manual page is updated to explain the way to many settings that can be configured. It was also restructured to give some format to the large number of customizable options.

myscrot

myscrot

somiaj added 13 commits April 15, 2024 02:37
Go through and spruce up the methods which respond to fvwm broadcasts. This includes:

* Add find_pager_window method to avoid duplication of window lookup code.
* Reduce number of extra loops when list_restack is called. The PagerWindows
  only need to be found once, so store the pointers in an array to lookup.
* Remove Procedure comments, the packet was not being printed to stderr.
* Add tab indention to all affected methods.
Unify data storage around the colors, labels, colorsets, pixmaps,
into a single DeskStyle structure. DeskStyle is a TAILQ list that
stores the configurable aspects of each desk. The first DeskStyle
for desk -1 is used as a default style, so any user settings to all
desks get applied to new desks as well. Additional DeskStyles are
created as needed. This allows users to configure all aspect per desk.
Extend the DeskStyles struct to be able to configure a bit more per
desk and standardize the configuration syntax to be able to set an
option for a specific desk or all desks. The syntax is now of the form
`Style [desk] value`. If desk is not included or is a '*', the style
is applied to all desks. As part of this, `DeskColor` and `DeskPixmap`
are no longer separate options and are just alias for `Back` and `Pixmap`.
Save the actual Pixel for the colors used in DeskStyle. The old Hilight
style was split into a HiFore and HiBack to match how the hilight
colorset is used. This gives four colors that can be set, Fore, Back,
HiFore and HiBack.

Add an initialized function which will save any colorset Pixel in the
DeskStyle Pixle, so there is no longer a need to test if the colorset
is configured, just use the Pixel stored in the DeskStyle.
The DeskStyles now store their own GCs, and they are no longer attached to
only the desks the pager is viewing. This has the advantage that per desk
colors can be set and update when only viewing the current desk.

This also cleans up the update code a bit to try to better centralize
updating the background colors when changing desks or updating colorsets.
When using CurrentDeskPerMonitor and fAlwaysCurrentDesks, the labels
will be drawn using the highlight color and will reflect which desk
is being shown, so color can be used to help determine which desk
each monitor is on.
Fix the function MovePage, it was doing more than it should and doing
stuff it shouldn't. Now all this method does is update the location of
the active monitor viewports.  Also rename MoveStickWindow to
MoveStickyWindows (since that is what it is doing), and clean up the logic
a little.
Pixmaps can be set both using Pixmap and Colorset options, and the
behavior between the two is similar.  This includes centralizing
the initialization and updating code to draw background colors or
pixmaps.

New option `LabelPixmap [desk] True|False`. By default any pixmaps
will be drawn in the root desktop window which contains the labels
and the desktop window, which is set as `ParentRelative` to the root
desktop window. If this option is disabled, then the pixmaps are
instead drawn in the desktop window, and the labels are drawn using
the foreground and background of the colorsets. This makes the labels
easier to use. Transparent colorsets will not function with this
disabled.

The highlighted labels are drawn by using filled rectangles. When
a pixmap is used as the background covering the labels, the rectangles
are still drawn highlighting the current desk. The new options
`LabelHilight / NoLabelHiligth`, can be used to turn this behavior
on or off. When the behavior is off, no filled rectangle is drawn,
though the text will written using the foreground of the hilight colorset.
Add window color and colorset settings to the DeskStyle struct
allow for per desk control of what windows look like. This includes
consolidation and cleanup of the code around drawing and updating
windows.
Remove some pointer variables that were never used. Free the list
of PagerWindows at exit.
@somiaj
Copy link
Collaborator Author

somiaj commented Apr 16, 2024

The colors even work when only showing the current desk and CurrentDeskPerMonitor, showing the color of the desktop the respective windows are in.

myscrot

somiaj added 2 commits April 16, 2024 12:01
Cleanup the balloon window code (there was a lot of duplication of
data and unused variables). The balloon window is a single window,
that only needs to be setup once and modified. Group all the balloon
configuration into a single struct.

This now makes BalloonColorset, BalloonFore, BalloonBack, and
BalloonBorderColor options configurable on a per desk basis using
DeskStyles.

BalloonBorderColor is unique in it will default to using the foreground
color, but can be set to use instead, and is not set using a colorset.
Add all the new DeskStyle options to the manual page, and organize the
configuration options into categories to make it easier to find and
understand what can be configured.
@somiaj somiaj force-pushed the js/pager-desk-styles branch from 3fc15c2 to d4045f4 Compare April 16, 2024 18:01
@ThomasAdam ThomasAdam self-assigned this Apr 17, 2024
@ThomasAdam ThomasAdam added type:enhancement Augmenting an existing feature relates:module Issue is in module code labels Apr 17, 2024
@ThomasAdam ThomasAdam added this to the 1.1.1 milestone Apr 17, 2024
@ThomasAdam ThomasAdam merged commit 767b717 into main Apr 17, 2024
5 checks passed
@ThomasAdam ThomasAdam deleted the js/pager-desk-styles branch April 17, 2024 12:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relates:module Issue is in module code type:enhancement Augmenting an existing feature
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants