Callisto FVWM patches

This commit is contained in:
Maia 2025-05-08 23:22:30 -07:00
parent 6a32c3188b
commit 2151c0ddfb
10 changed files with 767 additions and 0 deletions

19
debian/patches/3001-focus_desktop.patch vendored Normal file
View File

@ -0,0 +1,19 @@
Description: Allow EWMH desktop windows to receive focus on mouseover
Upstream FVWM's HandleEnterNotify returns early when it encounters
an EWMH desktop window, preventing a focus change from taking place.
We remove this return instruction to allow processing to continue
as for other window types. This is necessary for strict MouseFocus
when running file managers that draw a desktop over the root window.
Origin: Callisto Desktop
Author: Maia <maia@tsundoku.ne.jp>
Last-Update: 2019-02-19
--- a/fvwm/events.c
+++ b/fvwm/events.c
@@ -2255,7 +2255,6 @@
BroadcastPacket(
MX_ENTER_WINDOW, 3, (long)Scr.Root, (long)NULL,
(long)NULL);
- return;
}
if (ewp->window == FW_W_FRAME(fw) ||
ewp->window == FW_W_ICON_TITLE(fw) ||

View File

@ -0,0 +1,22 @@
Description: Keep dialog windows on top
A trivial patch to the EWMH special cases that keeps dialog windows above others,
modeled after the way desktop windows are kept on the bottom. Implemented to resolve
issues with caja (née nautilus) dialogs spawning under other applications' windows,
probably a side effect of unanticipated MouseFocus.
Origin: Callisto Desktop
Author: Maia <maia@tsundoku.ne.jp>
Last-Update: 2019-02-19
--- a/fvwm/ewmh.c
+++ b/fvwm/ewmh.c
@@ -1412,6 +1412,11 @@
{
fw->ewmh_window_type = EWMH_WINDOW_TYPE_DIALOG_ID;
+ SSET_LAYER(*style, 6);
+ style->flags.use_layer = 1;
+ style->flag_mask.use_layer = 1;
+ style->change_mask.use_layer = 1;
+
return 0;
}

View File

@ -0,0 +1,53 @@
Description: Do not draw stippled lines on sticky windows
FVWM is hardcoded to draw a pattern of recessed lines on the titlebars of
sticky windows. Our decorations have a sticky button that indicates state with
MwmDecorStick instead.
Origin: Callisto Desktop
Author: Maia <maia@tsundoku.ne.jp>
Last-Update: 2019-02-19
--- a/fvwm/borders.c
+++ b/fvwm/borders.c
@@ -3751,7 +3751,6 @@
border_draw_title_deep(fw, td, &tdd, &fstr, *dest_pix, w);
}
border_draw_title_relief(fw, td, &tdd, *dest_pix);
- border_draw_title_stick_lines(fw, td, &tdd, *dest_pix);
return;
}
--- a/fvwm/icons.c
+++ b/fvwm/icons.c
@@ -1084,33 +1084,6 @@
ICON_HEIGHT(fw) - 1,
(fw->icon_title_relief > 0)? Relief:Shadow,
(fw->icon_title_relief > 0)? Shadow:Relief, relief);
- if (is_stippled)
- {
- /* an odd number of lines every 4 pixels */
- int pseudo_height = ICON_HEIGHT(fw)- 2*relief + 2;
- int num = (pseudo_height /
- ICON_TITLE_STICK_VERT_DIST / 2) * 2 - 1;
- int min = ICON_HEIGHT(fw) / 2 -
- num * 2 + 1;
- int max = ICON_HEIGHT(fw) / 2 +
- num * 2 - ICON_TITLE_STICK_VERT_DIST + 1;
- int i;
-
- for(i = min; w_stipple > 0 && i <= max;
- i += ICON_TITLE_STICK_VERT_DIST)
- {
- RelieveRectangle(
- dpy, FW_W_ICON_TITLE(fw), x_stipple,
- i, w_stipple - 1, 1, Shadow,
- Relief, ICON_TITLE_STICK_HEIGHT);
- RelieveRectangle(
- dpy, FW_W_ICON_TITLE(fw),
- w_title_w - x_stipple - w_stipple, i,
- w_stipple - 1, 1, Shadow, Relief,
- ICON_TITLE_STICK_HEIGHT);
- }
- }
-
return;
}

View File

@ -0,0 +1,25 @@
Description: Allow EnvIsSet tests to be performed on InfoStore variables
A patch from upstream for a minor oversight, not yet released.
Origin: https://github.com/fvwmorg/fvwm/commit/d950dabf4d815fb59babe2b40200f52b248a04c8
Author: Maia <maia@tsundoku.ne.jp>
Last-Update: 2019-02-19
--- a/fvwm/conditional.c
+++ b/fvwm/conditional.c
@@ -2101,8 +2101,15 @@
flags_ptr = GetNextSimpleOption(flags_ptr, &var_name);
if (var_name)
{
- const char *value = getenv(var_name);
-
+ const char *value;
+ if ( (strlen(var_name) > 10) && (memcmp(var_name,"infostore.",10) == 0) )
+ {
+ value = get_metainfo_value(var_name + 10);
+ }
+ else
+ {
+ value = getenv(var_name);
+ }
match = (value != NULL) ? 1 : 0;
}
else

View File

@ -0,0 +1,244 @@
Description: Add support for EWMH focused hint
Set the hint used by GTK+ 3 to draw widgets in unfocused windows
in the backdrop state. This patch is not very good, and it should
be reworked at some point to toggle the hint at a more appropriate
occasion. A side effect of this patch's sloppiness is that the hint
is not set when the cursor is in the titlebar, for example.
Source: Callisto Desktop
Author: Maia <maia@tsundoku.ne.jp>
Last-Update: 2020-08-18
--- a/fvwm/events.c
+++ b/fvwm/events.c
@@ -2291,6 +2291,7 @@
/* Event is for the frame...*/
SetFocusWindow(fw, True, FOCUS_SET_BY_ENTER);
}
+ SET_EWMH_FOCUSED(fw, True);
}
else if (focus_is_focused(fw) && focus_does_accept_input_focus(fw))
{
@@ -2819,6 +2820,11 @@
/* handle a subwindow cmap */
LeaveSubWindowColormap(te->xany.window);
}
+ if (fw != NULL && IS_EWMH_FOCUSED(fw))
+ {
+ SET_EWMH_FOCUSED(fw, False);
+ EWMH_SetWMState(fw, False);
+ }
if (fw != NULL &&
(lwp->window == FW_W_FRAME(fw) ||
lwp->window == FW_W_ICON_TITLE(fw) ||
--- a/fvwm/ewmh.c
+++ b/fvwm/ewmh.c
@@ -143,6 +143,9 @@
"_NET_WM_STATE_BELOW", XA_ATOM,
ewmh_WMStateStaysOnBottom),
ENTRY(
+ "_NET_WM_STATE_FOCUSED", XA_ATOM,
+ ewmh_WMStateFocused),
+ ENTRY(
"_NET_WM_STATE_FULLSCREEN", XA_ATOM,
ewmh_WMStateFullScreen),
ENTRY("_NET_WM_STATE_HIDDEN", XA_ATOM, ewmh_WMStateHidden),
@@ -621,6 +624,7 @@
void EWMH_SetWMState(FvwmWindow *fw, Bool do_restore)
{
+ DBUG("EWMH_SetWMState", "Routine Entered");
Atom wm_state[EWMH_NUMBER_OF_STATE];
int i = 0;
ewmh_atom *list = ewmh_atom_wm_state;
@@ -634,18 +638,9 @@
list++;
}
- if (i > 0)
- {
- ewmh_ChangeProperty(
- FW_W(fw), "_NET_WM_STATE", EWMH_ATOM_LIST_CLIENT_WIN,
- (unsigned char *)wm_state, i);
- }
- else
- {
- ewmh_DeleteProperty(
- FW_W(fw), "_NET_WM_STATE",
- EWMH_ATOM_LIST_CLIENT_WIN);
- }
+ ewmh_ChangeProperty(
+ FW_W(fw), "_NET_WM_STATE", EWMH_ATOM_LIST_CLIENT_WIN,
+ (unsigned char *)wm_state, i);
return;
}
--- a/fvwm/ewmh_events.c
+++ b/fvwm/ewmh_events.c
@@ -564,6 +564,16 @@
return 0;
}
+int ewmh_WMStateFocused(
+ FvwmWindow *fw, XEvent *ev, window_style *style, unsigned long any)
+{
+ if (ev == NULL && style == NULL)
+ {
+ return (IS_EWMH_FOCUSED(fw));
+ }
+ /* Read only value for clients. We do not set it here */
+}
+
int ewmh_WMStateFullScreen(
FvwmWindow *fw, XEvent *ev, window_style *style, unsigned long any)
{
--- a/fvwm/ewmh_intern.h
+++ b/fvwm/ewmh_intern.h
@@ -138,6 +138,8 @@
int ewmh_WMState(
FvwmWindow *fw, XEvent *ev, window_style *style, unsigned long any);
+int ewmh_WMStateFocused(
+ FvwmWindow *fw, XEvent *ev, window_style *style, unsigned long any);
int ewmh_WMStateFullScreen(
FvwmWindow *fw, XEvent *ev, window_style *style, unsigned long any);
int ewmh_WMStateHidden(
--- a/fvwm/focus.c
+++ b/fvwm/focus.c
@@ -963,6 +963,15 @@
}
set_focus_to_fwin(FW_W(fw), fw, &sf_args);
+ DBUG("SetFocusWindow", "_NET_WM_STATE_FOCUSED");
+ /* Set _NET_WM_STATE_FOCUSED for window to receive focus */
+ /* Not for icons because they would keep it when being deiconified */
+ if (!IS_ICONIFIED(fw))
+ {
+ SET_EWMH_FOCUSED(fw, True);
+ EWMH_SetWMState(fw, False);
+ }
+
return;
}
@@ -985,6 +994,7 @@
void _DeleteFocus(Bool do_allow_force_broadcast)
{
sftfwin_args_t sf_args;
+ FvwmWindow *t;
memset(&sf_args, 0, sizeof(sf_args));
sf_args.do_allow_force_broadcast = !!do_allow_force_broadcast;
@@ -995,12 +1005,22 @@
sf_args.set_by = FOCUS_SET_FORCE;
set_focus_to_fwin(Scr.NoFocusWin, NULL, &sf_args);
+ for (t = Scr.FvwmRoot.next; t != NULL; t = t->next)
+ {
+ if (IS_EWMH_FOCUSED(t))
+ {
+ SET_EWMH_FOCUSED(t, False);
+ EWMH_SetWMState(t, False);
+ }
+ }
+
return;
}
void _ForceDeleteFocus(void)
{
sftfwin_args_t sf_args;
+ FvwmWindow *t;
memset(&sf_args, 0, sizeof(sf_args));
sf_args.do_allow_force_broadcast = 1;
@@ -1011,6 +1031,15 @@
sf_args.set_by = FOCUS_SET_FORCE;
set_focus_to_fwin(Scr.NoFocusWin, NULL, &sf_args);
+ for (t = Scr.FvwmRoot.next; t != NULL; t = t->next)
+ {
+ if (IS_EWMH_FOCUSED(t))
+ {
+ SET_EWMH_FOCUSED(t, False);
+ EWMH_SetWMState(t, False);
+ }
+ }
+
return;
}
--- a/fvwm/fvwm.h
+++ b/fvwm/fvwm.h
@@ -382,10 +382,12 @@
/* the ewmh icon is used as icon pixmap */
unsigned use_ewmh_icon : 1;
unsigned is_ewmh_modal : 1;
+ unsigned is_ewmh_focused : 1;
unsigned is_ewmh_fullscreen : 1;
#define EWMH_STATE_UNDEFINED_HINT 0
#define EWMH_STATE_NO_HINT 1
#define EWMH_STATE_HAS_HINT 2
+ unsigned has_ewmh_init_focused_state : 2;
unsigned has_ewmh_init_fullscreen_state : 2;
unsigned has_ewmh_init_hidden_state : 2;
unsigned has_ewmh_init_maxhoriz_state : 2;
--- a/fvwm/icons.c
+++ b/fvwm/icons.c
@@ -2512,6 +2512,15 @@
SET_ICONIFIED(t, 1);
SET_ICON_UNMAPPED(t, 1);
SET_ICONIFIED_BY_PARENT(t, 1);
+
+ /* Remove _NET_WM_STATE_FOCUSED atom if present */
+ DBUG("Iconify", "unfocus t");
+ if (IS_EWMH_FOCUSED(t))
+ {
+ SET_EWMH_FOCUSED(t, False);
+ EWMH_SetWMState(t, False);
+ }
+
get_icon_geometry(t, &g);
BroadcastPacket(
M_ICONIFY, 7, (long)FW_W(t),
@@ -2575,6 +2584,15 @@
}
SET_ICONIFIED(fw, 1);
SET_ICON_UNMAPPED(fw, 0);
+
+ /* Remove _NET_WM_STATE_FOCUSED atom if present */
+ if (IS_EWMH_FOCUSED(fw))
+ {
+ DBUG("Iconify", "unfocus fw");
+ SET_EWMH_FOCUSED(fw, False);
+ EWMH_SetWMState(fw, False);
+ }
+
get_icon_geometry(fw, &icon_rect);
/* if this fails it does not overwrite icon_rect */
EWMH_GetIconGeometry(fw, &icon_rect);
--- a/fvwm/window_flags.h
+++ b/fvwm/window_flags.h
@@ -680,12 +680,24 @@
(fw)->flags.is_ewmh_modal = !!(x)
#define SETM_EWMH_MODAL(fw,x) \
(fw)->flag_mask.is_ewmh_modal = !!(x)
+#define IS_EWMH_FOCUSED(fw) \
+ ((fw)->flags.is_ewmh_focused)
+#define SET_EWMH_FOCUSED(fw,x) \
+ (fw)->flags.is_ewmh_focused = !!(x)
+#define SETM_EWMH_FOCUSED(fw,x) \
+ (fw)->flag_mask.is_ewmh_focused = !!(x)
#define IS_EWMH_FULLSCREEN(fw) \
((fw)->flags.is_ewmh_fullscreen)
#define SET_EWMH_FULLSCREEN(fw,x) \
(fw)->flags.is_ewmh_fullscreen = !!(x)
#define SETM_EWMH_FULLSCREEN(fw,x) \
(fw)->flag_mask.is_ewmh_fullscreen = !!(x)
+#define SET_HAS_EWMH_INIT_FOCUSED_STATE(fw,x) \
+ (fw)->flags.has_ewmh_init_focused_state = (x)
+#define SETM_HAS_EWMH_INIT_FOCUSED_STATE(fw,x) \
+ (fw)->flag_mask.has_ewmh_init_focused_state = (x)
+#define HAS_EWMH_INIT_FOCUSED_STATE(fw) \
+ ((fw)->flags.has_ewmh_init_focused_state)
#define SET_HAS_EWMH_INIT_FULLSCREEN_STATE(fw,x) \
(fw)->flags.has_ewmh_init_fullscreen_state = (x)
#define SETM_HAS_EWMH_INIT_FULLSCREEN_STATE(fw,x) \

View File

@ -0,0 +1,18 @@
Description: Reduce geometry window relief
FVWM has a harccoded relief of 2 pixels for the geometry window.
Our style uses a relief of 1 pixel across the board, so the
geometry window should match.
Origin: Callisto Desktop
Author: Maia <maia@tsundoku.ne.jp>
Last-Update: 2019-02-19
--- a/libs/defaults.h
+++ b/libs/defaults.h
@@ -153,7 +153,7 @@
#define BROKEN_MINSIZE_LIMIT 30000
/* geometry window */
-#define GEOMETRY_WINDOW_BW 2 /* pixels */
+#define GEOMETRY_WINDOW_BW 1 /* pixel */
#define GEOMETRY_WINDOW_STRING " +8888 x +8888 "
#define GEOMETRY_WINDOW_POS_STRING " %+-4d %+-4d "
#define GEOMETRY_WINDOW_SIZE_STRING " %4d x %-4d "

View File

@ -0,0 +1,208 @@
Description: Adjust hardcoded menu style to match Callisto GTK theme
Some aspects of menu drawing that are needed in order to match
Callisto themes are not exposed through the configuration interface.
Origin: Callisto Desktop
Author: Maia <maia@tsundoku.ne.jp>
Last-Update: 2019-02-19
--- a/fvwm/menuitem.c
+++ b/fvwm/menuitem.c
@@ -81,10 +81,11 @@
*
*/
static void draw_separator(
- Window w, GC TopGC, GC BottomGC, int x1, int y, int x2)
+ Window w, GC TopGC, GC LineGC, GC BottomGC, int x1, int y, int x2)
{
- XDrawLine(dpy, w, TopGC , x1, y, x2, y);
- XDrawLine(dpy, w, BottomGC, x1-1, y+1, x2+1, y+1);
+ XDrawLine(dpy, w, TopGC , x1 + 1, y - 1, x2, y - 1);
+ XDrawLine(dpy, w, LineGC , x1, y, x2, y);
+ XDrawLine(dpy, w, BottomGC , x1, y + 1, x2 - 1, y + 1);
return;
}
@@ -373,6 +374,7 @@
int lit_x_start;
int lit_x_end;
gc_quad_t gcs;
+ gc_quad_t active_gcs;
gc_quad_t off_gcs;
int cs = -1;
int off_cs;
@@ -464,6 +466,8 @@
{
gcs = ST_MENU_INACTIVE_GCS(ms);
off_gcs = ST_MENU_INACTIVE_GCS(ms);
+ active_gcs = ST_MENU_ACTIVE_GCS(ms);
+
}
if (is_item_selected)
{
@@ -542,8 +546,8 @@
}
else if (MI_IS_TITLE(mi))
{
- lit_x_start = MDIM_ITEM_X_OFFSET(*dim);
- lit_x_end = lit_x_start + MDIM_ITEM_WIDTH(*dim);
+ lit_x_start = MDIM_HILIGHT_X_OFFSET(*dim);
+ lit_x_end = lit_x_start + MDIM_HILIGHT_WIDTH(*dim);
/* Hilight the background. */
if (
MDIM_HILIGHT_WIDTH(*dim) > 0 &&
@@ -551,9 +555,9 @@
{
draw_highlight_background(
mpip, lit_x_start,
- y_offset + relief_thickness,
+ y_offset,
lit_x_end - lit_x_start,
- y_height - relief_thickness,
+ y_height,
(cs >= 0 ? &Colorset[cs] : NULL),
gcs.back_gc);
item_cleared = True;
@@ -601,9 +605,8 @@
/* Calculate the separator offsets. */
if (ST_HAS_LONG_SEPARATORS(ms))
{
- sx1 = MDIM_ITEM_X_OFFSET(*dim) + relief_thickness;
- sx2 = MDIM_ITEM_X_OFFSET(*dim) + MDIM_ITEM_WIDTH(*dim) - 1 -
- relief_thickness;
+ sx1 = MDIM_ITEM_X_OFFSET(*dim) - relief_thickness;
+ sx2 = MDIM_ITEM_X_OFFSET(*dim) + MDIM_ITEM_WIDTH(*dim);
}
else
{
@@ -618,8 +621,8 @@
{
/* It's a separator. */
draw_separator(
- mpip->w, gcs.shadow_gc, gcs.hilight_gc, sx1,
- y_offset + y_height - MENU_SEPARATOR_HEIGHT,
+ mpip->w, gcs.shadow_gc, active_gcs.hilight_gc, gcs.hilight_gc, sx1,
+ (y_offset + y_height - MENU_SEPARATOR_HEIGHT) + 2,
sx2);
/* Nothing else to do. */
}
@@ -660,7 +663,7 @@
if (sx1 < sx2)
{
draw_separator(
- mpip->w, gcs.shadow_gc, gcs.hilight_gc,
+ mpip->w, gcs.shadow_gc, active_gcs.hilight_gc, gcs.hilight_gc,
sx1, y, sx2);
}
}
@@ -674,7 +677,7 @@
{
y = y_offset + y_height - MENU_SEPARATOR_HEIGHT;
draw_separator(
- mpip->w, gcs.shadow_gc, gcs.hilight_gc,
+ mpip->w, gcs.shadow_gc, active_gcs.hilight_gc, gcs.hilight_gc,
sx1, y, sx2);
}
break;
--- a/fvwm/menus.c
+++ b/fvwm/menus.c
@@ -1151,6 +1151,7 @@
int left_objects = 0;
int right_objects = 0;
int x;
+ int xsub;
unsigned char icons_placed = 0;
Bool sidepic_placed = False;
Bool triangle_placed = False;
@@ -1265,6 +1266,7 @@
if (*format == 'r')
{
right_objects++;
+ xsub = x;
}
else
{
@@ -1368,13 +1370,11 @@
triangle_placed = True;
if (msp->max.i.triangle_width > 0)
{
- x += gap_left;
+ x = xsub;
MR_TRIANGLE_X_OFFSET(
- msp->menu) = x;
+ msp->menu) = xsub - msp->max.i.triangle_width + 1;
MR_IS_LEFT_TRIANGLE(msp->menu) =
(*format == '<');
- x += msp->max.i.triangle_width +
- gap_right;
item_order[used_objects++] =
&(MR_TRIANGLE_X_OFFSET(
msp->menu));
@@ -1797,7 +1797,7 @@
/* don't propagate sidepic, sidecolor, popup and
* popdown actions */
/* And add the entry pointing to the new menu */
- gt_name = gettext("More&...");
+ gt_name = gettext("継続...");
name = safestrdup(gt_name);
AddToMenu(
msp->menu, name, tempname,
@@ -2706,10 +2706,15 @@
* redrawing several menu items. */
RelieveRectangle(
dpy, MR_WINDOW(mr), 0, 0, MR_WIDTH(mr) - 1,
- MR_HEIGHT(mr) - 1, (Pdepth < 2) ?
+ MR_HEIGHT(mr) - 1,
+ HILIGHT_GC(MST_MENU_ACTIVE_GCS(mr)),
+ HILIGHT_GC(MST_MENU_ACTIVE_GCS(mr)), bw);
+ RelieveRectangle(
+ dpy, MR_WINDOW(mr), 1, 1, MR_WIDTH(mr) - 3,
+ MR_HEIGHT(mr) - 3, (Pdepth < 2) ?
SHADOW_GC(MST_MENU_INACTIVE_GCS(mr)) :
HILIGHT_GC(MST_MENU_INACTIVE_GCS(mr)),
- SHADOW_GC(MST_MENU_INACTIVE_GCS(mr)), bw);
+ SHADOW_GC(MST_MENU_INACTIVE_GCS(mr)), bw - 1);
{
return;
}
@@ -2759,11 +2764,16 @@
}
} /* if (ms) */
/* draw the relief */
- RelieveRectangle(dpy, MR_WINDOW(mr), 0, 0, MR_WIDTH(mr) - 1,
- MR_HEIGHT(mr) - 1, (Pdepth < 2) ?
+ RelieveRectangle(
+ dpy, MR_WINDOW(mr), 0, 0, MR_WIDTH(mr) - 1,
+ MR_HEIGHT(mr) - 1,
+ HILIGHT_GC(MST_MENU_ACTIVE_GCS(mr)),
+ HILIGHT_GC(MST_MENU_ACTIVE_GCS(mr)), bw);
+ RelieveRectangle(dpy, MR_WINDOW(mr), 1, 1, MR_WIDTH(mr) - 3,
+ MR_HEIGHT(mr) - 3, (Pdepth < 2) ?
SHADOW_GC(MST_MENU_INACTIVE_GCS(mr)) :
HILIGHT_GC(MST_MENU_INACTIVE_GCS(mr)),
- SHADOW_GC(MST_MENU_INACTIVE_GCS(mr)), bw);
+ SHADOW_GC(MST_MENU_INACTIVE_GCS(mr)), bw - 1);
/* paint the menu items */
for (mi = MR_FIRST_ITEM(mr); mi != NULL; mi = MI_NEXT_ITEM(mi))
{
--- a/libs/defaults.h
+++ b/libs/defaults.h
@@ -61,16 +61,16 @@
#define DEFAULT_MENU_ITEM_FORMAT "%s%.1|%.5i%.5l%.5l%.5r%.5i%2.3>%1|"
#define DEFAULT_LEFT_MENU_ITEM_FORMAT "%.1|%3.2<%5i%5l%5l%5r%5i%1|%s"
/* size of the submenu triangle. */
-#define MENU_TRIANGLE_WIDTH 5 /* pixels */
-#define MENU_TRIANGLE_HEIGHT 9 /* pixels */
+#define MENU_TRIANGLE_WIDTH 7 /* pixels */
+#define MENU_TRIANGLE_HEIGHT 11 /* pixels */
/* menu underline parameters */
#define MENU_UNDERLINE_THICKNESS 1 /* pixels */
#define MENU_UNDERLINE_GAP 1 /* pixels */
#define MENU_UNDERLINE_HEIGHT (MENU_UNDERLINE_THICKNESS + MENU_UNDERLINE_GAP)
/* menu separator parameters */
-#define MENU_SEPARATOR_SHORT_X_OFFSET 5 /* pixels */
+#define MENU_SEPARATOR_SHORT_X_OFFSET 2 /* pixels */
#define MENU_SEPARATOR_Y_OFFSET 2 /* pixels */
-#define MENU_SEPARATOR_HEIGHT 2 /* pixels */
+#define MENU_SEPARATOR_HEIGHT 5 /* pixels */
#define MENU_SEPARATOR_TOTAL_HEIGHT \
(MENU_SEPARATOR_HEIGHT + MENU_SEPARATOR_Y_OFFSET)
/* menu tear off bar parameters */

View File

@ -0,0 +1,150 @@
Description: Modify WindowList style and contents
We want to customize WindowList in ways that are not exposed
through the configuration interface. In addition to style tweaks,
we also add submenus for actions targeting all windows on a desk.
Author: Maia <maia@tsundoku.ne.jp>
Date: 2022-06-11
diff -urN a/fvwm/windowlist.c b/fvwm/windowlist.c
--- a/fvwm/windowlist.c 2018-05-26 04:35:26.000000000 -0700
+++ b/fvwm/windowlist.c 2022-06-11 16:30:47.168556240 -0700
@@ -87,24 +87,22 @@
if (desk_name != NULL)
{
- if (flags & NO_NUM_IN_DESK_TITLE)
+ if (flags & SHOW_ALLDESKS)
{
- sprintf(tlabel, "%s%s", desk_name,
- (is_top_title && (flags & SHOW_GEOMETRY)) ?
- _("\tGeometry") : "");
+ sprintf(tlabel, "%s%s", desk_name, _("\t %ops/every.png%"));
}
else
{
- sprintf(tlabel,"%d: %s%s", desk, desk_name,
- (is_top_title && (flags & SHOW_GEOMETRY)) ?
- _("\tGeometry") : "");
+ sprintf(tlabel, "%s%s", desk_name,
+ (is_top_title && (flags & SHOW_ICONIC)) ?
+ _("\t非表示%ops/hidden_group.png%") : _("\t %team.png%"));
}
}
else
{
sprintf(tlabel,_("Desk: %d%s"),desk,
- (is_top_title && (flags & SHOW_GEOMETRY)) ?
- _("\tGeometry") : "");
+ (is_top_title && (flags & SHOW_ICONIC)) ?
+ _("\t非表示%ops/hidden_group.png%") : _("\t %ops/every.png%"));
}
return tlabel;
@@ -199,6 +197,8 @@
FvwmWindow **windowList;
FvwmWindow **iconifiedList = NULL;
int numWindows;
+ int numIcons;
+ int numNormal;
int ii;
char tname[128];
char loc[64];
@@ -576,12 +576,14 @@
mr = NewMenuRoot(tlabel);
if (!(flags & NO_CURRENT_DESK_TITLE))
{
- AddToMenu(mr, tlabel, "TITLE", False, False, False);
+ AddToMenu(mr, tlabel, "TITLE", True, False, False);
empty_menu = False;
}
free(tlabel);
numWindows = 0;
+ numIcons = 0;
+ numNormal = 0;
for (t = Scr.FvwmRoot.next; t != NULL; t = t->next)
{
numWindows++;
@@ -743,6 +745,20 @@
for (ii = 0; ii < numWindows; ii++)
{
t = windowList[ii];
+
+ /* count icons to determine whether to build contents into the icon operations menu */
+ if ((t->Desk == desk) && !(DO_SKIP_WINDOW_LIST(t)))
+ {
+ if (IS_ICONIFIED(t))
+ {
+ numIcons++;
+ }
+ else
+ {
+ numNormal++;
+ }
+ }
+
if (t->Desk != next_desk && !(flags & NO_DESK_SORT))
{
continue;
@@ -815,7 +831,7 @@
t->Desk, flags, False);
AddToMenu(
mr, tlabel, "TITLE",
- False, False, False);
+ True, False, False);
free(tlabel);
}
}
@@ -825,7 +841,7 @@
{
tlabel = get_desk_title(t->Desk, flags, False);
AddToMenu(
- mr, tlabel, "TITLE", False, False,
+ mr, tlabel, "TITLE", True, False,
False);
free(tlabel);
}
@@ -1036,11 +1052,43 @@
}
}
+ /* add the universal operations header or a "no windows" entry if appropriate */
+ if (!(flags & NO_CURRENT_DESK_TITLE))
+ {
+
+ if (flags & SHOW_ICONIC)
+ {
+ if (numIcons)
+ {
+ AddToMenu(mr, "", "Nop", False, False, False);
+ AddToMenu(mr, "すべてを送る%ops/send_hidden.png%", "Popup DeskSendHidden", True, False, False);
+ AddToMenu(mr, "すべてを表示%ops/every.png%", "DeiconifyEvery", True, False, False);
+ }
+ else
+ {
+ AddToMenu(mr, "非表示ウィンドウがありません", "Nop", False, False, False);
+ }
+ }
+ else
+ {
+ if (numNormal)
+ {
+ AddToMenu(mr, "", "Nop", False, False, False);
+ AddToMenu(mr, "すべてを送る%ops/send_all.png%", "Popup DeskSendVisible", True, False, False);
+ AddToMenu(mr, "すべてを隠す%ops/hide_all.png%", "IconifyEvery", True, False, False);
+ }
+ else
+ {
+ AddToMenu(mr, "ウィンドウがありません", "Nop", False, False, False);
+ }
+ }
+ }
+
if (empty_menu)
{
/* force current desk title */
tlabel = get_desk_title(desk, flags, True);
- AddToMenu(mr, tlabel, "TITLE", False, False, False);
+ AddToMenu(mr, tlabel, "TITLE", True, False, False);
free(tlabel);
}

View File

@ -0,0 +1,19 @@
Description: Raise the title position one pixel
With the upstream code and our specific setup of fonts and
titlebar settings, FVWM draws window title text slightly off
center. Subtract one pixel from the y coordinate for the draw
(counted downwards from the top of the titlebar) so that
titles are vertically centered.
Author: Maia <maia@tsundoku.ne.jp>
Date: 2022-05-30
diff -urN a/fvwm/borders.c b/fvwm/borders.c
--- a/fvwm/borders.c 2018-05-26 04:35:26.000000000 -0700
+++ b/fvwm/borders.c 2022-05-30 19:31:04.048007353 -0700
@@ -3610,6 +3610,7 @@
1);
}
}
+ tdd->fstr.y--;
FlocaleDrawString(dpy, fw->title_font, &tdd->fstr, 0);
return;

View File

@ -4,3 +4,12 @@ fix-hardcoded-xterm.patch
default-config-fvwm2.patch
spelling-error-fix.patch
remove-Werror-check.patch
3001-focus_desktop.patch
3002-dialogs_on_top.patch
3003-disable_sticky_stipple.patch
3004-envisset_infostore.patch
3005-ewmh_focused_state.patch
3006-geometrywindow_relief.patch
3007-menustyle_callisto.patch
3008-windowlist_callisto.patch
3009-window_title_raise.patch