-
Notifications
You must be signed in to change notification settings - Fork 1
/
0002-Coloured-Borders.patch
1942 lines (1914 loc) · 59.2 KB
/
0002-Coloured-Borders.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
From 069f6319cc482868485113f64176f656cf82c3b1 Mon Sep 17 00:00:00 2001
From: Anupam Srivastava <ansrivastava@corp.ebay.com>
Date: Sat, 2 May 2015 13:21:47 +0530
Subject: [PATCH 02/13] Coloured Borders
---
fvwm/borders.c | 436 ++++++++++++++++++++++++++++++++--
fvwm/fvwm.c | 15 ++
fvwm/fvwm.h | 72 ++++++
fvwm/move_resize.c | 114 +++++----
fvwm/screen.h | 15 ++
fvwm/style.c | 663 ++++++++++++++++++++++++++++++++++++++++++++++++++++
fvwm/style.h | 102 +++++++-
fvwm/window_flags.h | 2 +
8 files changed, 1350 insertions(+), 69 deletions(-)
diff --git a/fvwm/borders.c b/fvwm/borders.c
index d348e8e..c18f777 100644
--- a/fvwm/borders.c
+++ b/fvwm/borders.c
@@ -124,13 +124,70 @@ typedef struct
int relief_width;
GC relief_gc;
GC shadow_gc;
+ GC relief_gc_north;
+ GC shadow_gc_north;
+ GC relief_gc_south;
+ GC shadow_gc_south;
+ GC relief_gc_east;
+ GC shadow_gc_east;
+ GC relief_gc_west;
+ GC shadow_gc_west;
+ GC relief_gc_nw;
+ GC shadow_gc_nw;
+ GC relief_gc_ne;
+ GC shadow_gc_ne;
+ GC relief_gc_sw;
+ GC shadow_gc_sw;
+ GC relief_gc_se;
+ GC shadow_gc_se;
+
Pixel fore_color;
Pixel back_color;
+ Pixel fore_color_north;
+ Pixel back_color_north;
+ Pixel fore_color_south;
+ Pixel back_color_south;
+ Pixel fore_color_east;
+ Pixel back_color_east;
+ Pixel fore_color_west;
+ Pixel back_color_west;
+ Pixel fore_color_nw;
+ Pixel back_color_nw;
+ Pixel fore_color_ne;
+ Pixel back_color_ne;
+ Pixel fore_color_sw;
+ Pixel back_color_sw;
+ Pixel fore_color_se;
+ Pixel back_color_se;
+
int cs;
+ int cs_north;
+ int cs_south;
+ int cs_east;
+ int cs_west;
int border_cs; /* for UseBorderStyle */
+ int border_cs_north;
+ int border_cs_south;
+ int border_cs_east;
+ int border_cs_west;
+
+ int cs_nw;
+ int cs_ne;
+ int cs_sw;
+ int cs_se;
int bg_border_cs; /* for UseBorderStyle */
Pixmap back_pixmap;
+
XSetWindowAttributes attributes;
+ XSetWindowAttributes attributes_north;
+ XSetWindowAttributes attributes_ne;
+ XSetWindowAttributes attributes_nw;
+ XSetWindowAttributes attributes_sw;
+ XSetWindowAttributes attributes_se;
+ XSetWindowAttributes attributes_south;
+ XSetWindowAttributes attributes_east;
+ XSetWindowAttributes attributes_west;
+
unsigned long valuemask;
Pixmap texture_pixmap;
int texture_pixmap_width;
@@ -329,10 +386,29 @@ static void get_common_decorations(
{
DecorFace *df;
color_quad *draw_colors;
+ color_quad *draw_colors_north;
+ color_quad *draw_colors_south;
+ color_quad *draw_colors_east;
+ color_quad *draw_colors_west;
+
+ color_quad *draw_colors_nw;
+ color_quad *draw_colors_ne;
+ color_quad *draw_colors_sw;
+ color_quad *draw_colors_se;
df = border_get_border_style(t, has_focus);
cd->bg_border_cs = -1;
cd->cs = -1;
+ cd->cs_north = -1;
+ cd->cs_south = -1;
+ cd->cs_east = -1;
+ cd->cs_west = -1;
+
+ cd->cs_nw = -1;
+ cd->cs_ne = -1;
+ cd->cs_sw = -1;
+ cd->cs_se = -1;
+
if (has_focus)
{
/* are we using textured borders? */
@@ -356,11 +432,61 @@ static void get_common_decorations(
{
draw_colors = &(t->border_hicolors);
cd->cs = t->border_cs_hi;
+
+ draw_colors_north = &(t->border_hicolors_north);
+ cd->cs_north = t->border_cs_hi_north;
+
+ draw_colors_south = &(t->border_hicolors_south);
+ cd->cs_south = t->border_cs_hi_south;
+
+ draw_colors_east = &(t->border_hicolors_east);
+ cd->cs_east = t->border_cs_hi_east;
+
+ draw_colors_west = &(t->border_hicolors_west);
+ cd->cs_west = t->border_cs_hi_west;
+
+ /* handles */
+ draw_colors_nw = &(t->border_hicolors_handles_nw);
+ cd->cs_nw = t->border_cs_hi_handles_nw;
+
+ draw_colors_ne = &(t->border_hicolors_handles_ne);
+ cd->cs_ne = t->border_cs_hi_handles_ne;
+
+ draw_colors_sw = &(t->border_hicolors_handles_sw);
+ cd->cs_sw = t->border_cs_hi_handles_sw;
+
+ draw_colors_se = &(t->border_hicolors_handles_se);
+ cd->cs_se = t->border_cs_hi_handles_se;
}
else
{
draw_colors = &(t->hicolors);
cd->cs = t->cs_hi;
+
+ draw_colors_north = &(t->hicolors);
+ cd->cs_north = t->cs_hi;
+
+ draw_colors_south = &(t->hicolors);
+ cd->cs_south = t->cs_hi;
+
+ draw_colors_east = &(t->hicolors);
+ cd->cs_east = t->cs_hi;
+
+ draw_colors_west = &(t->hicolors);
+ cd->cs_west = t->cs_hi;
+
+ /* handles */
+ draw_colors_nw = &(t->hicolors);
+ cd->cs_nw = t->cs_hi;
+
+ draw_colors_ne = &(t->hicolors);
+ cd->cs_ne = t->cs_hi;
+
+ draw_colors_sw = &(t->hicolors);
+ cd->cs_sw = t->cs_hi;
+
+ draw_colors_se = &(t->hicolors);
+ cd->cs_se = t->cs_hi;
}
}
else
@@ -392,15 +518,91 @@ static void get_common_decorations(
{
draw_colors = &(t->border_colors);
cd->cs = t->border_cs;
+
+ draw_colors_north = &(t->border_colors_north);
+ cd->cs_north = t->border_cs_north;
+
+ draw_colors_south = &(t->border_colors_south);
+ cd->cs_south = t->border_cs_south;
+
+ draw_colors_east = &(t->border_colors_east);
+ cd->cs_east = t->border_cs_east;
+
+ draw_colors_west = &(t->border_colors_west);
+ cd->cs_west = t->border_cs_west;
+
+ /* handles */
+ draw_colors_nw = &(t->border_colors_handles_nw);
+ cd->cs_nw = t->border_cs_handles_nw;
+
+ draw_colors_ne = &(t->border_colors_handles_ne);
+ cd->cs_ne = t->border_cs_handles_ne;
+
+ draw_colors_sw = &(t->border_colors_handles_sw);
+ cd->cs_sw = t->border_cs_handles_sw;
+
+ draw_colors_se = &(t->border_colors_handles_se);
+ cd->cs_se = t->border_cs_handles_se;
+
}
else
{
draw_colors = &(t->colors);
cd->cs = t->cs;
+
+ draw_colors_north = &(t->border_colors_north);
+ cd->cs_north = t->cs;
+
+ draw_colors_south = &(t->border_colors_south);
+ cd->cs_south = t->cs;
+
+ draw_colors_east = &(t->border_colors_east);
+ cd->cs_east = t->cs;
+
+ draw_colors_west = &(t->border_colors_west);
+ cd->cs_west = t->cs;
+
+ /* handles */
+ draw_colors_nw = &(t->border_colors_handles_nw);
+ cd->cs_nw = t->border_cs_handles_nw;
+
+ draw_colors_ne = &(t->border_colors_handles_ne);
+ cd->cs_ne = t->border_cs_handles_ne;
+
+ draw_colors_sw = &(t->border_colors_handles_sw);
+ cd->cs_sw = t->border_cs_handles_sw;
+
+ draw_colors_se = &(t->border_colors_handles_se);
+ cd->cs_se = t->border_cs_handles_se;
}
}
cd->fore_color = draw_colors->fore;
cd->back_color = draw_colors->back;
+
+ cd->fore_color_north = draw_colors_north->fore;
+ cd->back_color_north = draw_colors_north->back;
+
+ cd->fore_color_south = draw_colors_south->fore;
+ cd->back_color_south = draw_colors_south->back;
+
+ cd->fore_color_east = draw_colors_east->fore;
+ cd->back_color_east = draw_colors_east->back;
+
+ cd->fore_color_west = draw_colors_west->fore;
+ cd->back_color_west = draw_colors_west->back;
+
+ cd->fore_color_nw = draw_colors_nw->fore;
+ cd->back_color_nw = draw_colors_nw->back;
+
+ cd->fore_color_ne = draw_colors_ne->fore;
+ cd->back_color_ne = draw_colors_ne->back;
+
+ cd->fore_color_sw = draw_colors_nw->fore;
+ cd->back_color_sw = draw_colors_nw->back;
+
+ cd->fore_color_se = draw_colors_se->fore;
+ cd->back_color_se = draw_colors_se->back;
+
if (do_change_gcs)
{
Globalgcv.foreground = draw_colors->hilight;
@@ -408,8 +610,75 @@ static void get_common_decorations(
XChangeGC(dpy, Scr.ScratchGC1, Globalgcm, &Globalgcv);
Globalgcv.foreground = draw_colors->shadow;
XChangeGC(dpy, Scr.ScratchGC2, Globalgcm, &Globalgcv);
+
+ Globalgcv.foreground = draw_colors_north->hilight;
+ XChangeGC(dpy, Scr.ScratchGC3, Globalgcm, &Globalgcv);
+ Globalgcv.foreground = draw_colors_north->shadow;
+ XChangeGC(dpy, Scr.ScratchGC4, Globalgcm, &Globalgcv);
+
+ Globalgcv.foreground = draw_colors_south->hilight;
+ XChangeGC(dpy, Scr.ScratchGC5, Globalgcm, &Globalgcv);
+ Globalgcv.foreground = draw_colors_south->shadow;
+ XChangeGC(dpy, Scr.ScratchGC6, Globalgcm, &Globalgcv);
+
+ Globalgcv.foreground = draw_colors_east->hilight;
+ XChangeGC(dpy, Scr.ScratchGC7, Globalgcm, &Globalgcv);
+ Globalgcv.foreground = draw_colors_east->shadow;
+ XChangeGC(dpy, Scr.ScratchGC8, Globalgcm, &Globalgcv);
+
+ Globalgcv.foreground = draw_colors_west->hilight;
+ XChangeGC(dpy, Scr.ScratchGC9, Globalgcm, &Globalgcv);
+ Globalgcv.foreground = draw_colors_west->shadow;
+ XChangeGC(dpy, Scr.ScratchGC10, Globalgcm, &Globalgcv);
+
+ /* handles. */
+ Globalgcv.foreground = draw_colors_nw->hilight;
+ XChangeGC(dpy, Scr.ScratchGC11, Globalgcm, &Globalgcv);
+ Globalgcv.foreground = draw_colors_nw->shadow;
+ XChangeGC(dpy, Scr.ScratchGC12, Globalgcm, &Globalgcv);
+
+ Globalgcv.foreground = draw_colors_ne->hilight;
+ XChangeGC(dpy, Scr.ScratchGC13, Globalgcm, &Globalgcv);
+ Globalgcv.foreground = draw_colors_ne->shadow;
+ XChangeGC(dpy, Scr.ScratchGC14, Globalgcm, &Globalgcv);
+
+ Globalgcv.foreground = draw_colors_sw->hilight;
+ XChangeGC(dpy, Scr.ScratchGC15, Globalgcm, &Globalgcv);
+ Globalgcv.foreground = draw_colors_sw->shadow;
+ XChangeGC(dpy, Scr.ScratchGC16, Globalgcm, &Globalgcv);
+
+ Globalgcv.foreground = draw_colors_se->hilight;
+ XChangeGC(dpy, Scr.ScratchGC17, Globalgcm, &Globalgcv);
+ Globalgcv.foreground = draw_colors_se->shadow;
+ XChangeGC(dpy, Scr.ScratchGC18, Globalgcm, &Globalgcv);
+
cd->relief_gc = Scr.ScratchGC1;
cd->shadow_gc = Scr.ScratchGC2;
+
+ cd->relief_gc_north = Scr.ScratchGC3;
+ cd->shadow_gc_north = Scr.ScratchGC4;
+
+ cd->relief_gc_south = Scr.ScratchGC5;
+ cd->shadow_gc_south = Scr.ScratchGC6;
+
+ cd->relief_gc_east = Scr.ScratchGC7;
+ cd->shadow_gc_east = Scr.ScratchGC8;
+
+ cd->relief_gc_west = Scr.ScratchGC9;
+ cd->shadow_gc_west = Scr.ScratchGC10;
+
+ /* Handles */
+ cd->relief_gc_nw = Scr.ScratchGC11;
+ cd->shadow_gc_nw = Scr.ScratchGC12;
+
+ cd->relief_gc_ne = Scr.ScratchGC13;
+ cd->shadow_gc_ne = Scr.ScratchGC14;
+
+ cd->relief_gc_sw = Scr.ScratchGC15;
+ cd->shadow_gc_sw = Scr.ScratchGC16;
+
+ cd->relief_gc_se = Scr.ScratchGC17;
+ cd->shadow_gc_se = Scr.ScratchGC18;
}
/* MWMBorder style means thin 3d effects */
@@ -430,6 +699,17 @@ static void get_common_decorations(
else
{
cd->attributes.background_pixel = cd->back_color;
+ cd->attributes_north.background_pixel = cd->back_color_north;
+ cd->attributes_south.background_pixel = cd->back_color_south;
+ cd->attributes_east.background_pixel = cd->back_color_east;
+ cd->attributes_west.background_pixel = cd->back_color_west;
+
+ /* handles */
+ cd->attributes_nw.background_pixel = cd->back_color_nw;
+ cd->attributes_ne.background_pixel = cd->back_color_ne;
+ cd->attributes_sw.background_pixel = cd->back_color_sw;
+ cd->attributes_se.background_pixel = cd->back_color_se;
+
cd->valuemask = CWBackPixel;
}
}
@@ -799,7 +1079,7 @@ static window_parts border_get_tb_parts_to_draw(
static void border_get_border_gcs(
draw_border_gcs *ret_gcs, common_decorations_type *cd, FvwmWindow *fw,
- Bool do_hilight)
+ Bool do_hilight, window_parts part)
{
static GC transparent_gc = None;
DecorFaceStyle *borderstyle;
@@ -823,17 +1103,102 @@ static void border_get_border_gcs(
{
is_reversed = True;
}
- if (is_reversed)
- {
- ret_gcs->shadow = cd->relief_gc;
- ret_gcs->relief = cd->shadow_gc;
- }
- else
- {
- ret_gcs->relief = cd->relief_gc;
- ret_gcs->shadow = cd->shadow_gc;
- }
+ switch ( part )
+ {
+ case PART_BORDER_N:
+ if( is_reversed )
+ {
+ ret_gcs->shadow = cd->relief_gc_north;
+ ret_gcs->relief = cd->shadow_gc_north;
+ } else {
+ ret_gcs->relief = cd->relief_gc_north;
+ ret_gcs->shadow = cd->shadow_gc_north;
+ }
+ break;
+ case PART_BORDER_S:
+ if( is_reversed )
+ {
+ ret_gcs->shadow = cd->relief_gc_south;
+ ret_gcs->relief = cd->shadow_gc_south;
+ } else {
+ ret_gcs->relief = cd->relief_gc_south;
+ ret_gcs->shadow = cd->shadow_gc_south;
+ }
+ break;
+ case PART_BORDER_E:
+ if( is_reversed )
+ {
+ ret_gcs->shadow = cd->relief_gc_east;
+ ret_gcs->relief = cd->shadow_gc_east;
+ } else {
+ ret_gcs->relief = cd->relief_gc_east;
+ ret_gcs->shadow = cd->shadow_gc_east;
+ }
+ break;
+ case PART_BORDER_W:
+ if( is_reversed )
+ {
+ ret_gcs->shadow = cd->relief_gc_west;
+ ret_gcs->relief = cd->shadow_gc_west;
+ } else {
+ ret_gcs->relief = cd->relief_gc_west;
+ ret_gcs->shadow = cd->shadow_gc_west;
+ }
+ break;
+ case PART_BORDER_NW:
+ if( is_reversed )
+ {
+ ret_gcs->shadow = cd->relief_gc_nw;
+ ret_gcs->relief = cd->shadow_gc_nw;
+ } else {
+ ret_gcs->relief = cd->relief_gc_nw;
+ ret_gcs->shadow = cd->shadow_gc_nw;
+ }
+ break;
+ case PART_BORDER_NE:
+ if( is_reversed )
+ {
+ ret_gcs->shadow = cd->relief_gc_ne;
+ ret_gcs->relief = cd->shadow_gc_ne;
+ } else {
+ ret_gcs->relief = cd->relief_gc_ne;
+ ret_gcs->shadow = cd->shadow_gc_ne;
+ }
+ break;
+ case PART_BORDER_SW:
+ if( is_reversed )
+ {
+ ret_gcs->shadow = cd->relief_gc_sw;
+ ret_gcs->relief = cd->shadow_gc_sw;
+ } else {
+ ret_gcs->relief = cd->relief_gc_sw;
+ ret_gcs->shadow = cd->shadow_gc_sw;
+ }
+ break;
+ case PART_BORDER_SE:
+ if( is_reversed )
+ {
+ ret_gcs->shadow = cd->relief_gc_se;
+ ret_gcs->relief = cd->shadow_gc_se;
+ } else {
+ ret_gcs->relief = cd->relief_gc_se;
+ ret_gcs->shadow = cd->shadow_gc_se;
+ }
+ break;
+ default:
+ if (is_reversed)
+ {
+ ret_gcs->shadow = cd->relief_gc;
+ ret_gcs->relief = cd->shadow_gc;
+ }
+ else
+ {
+ ret_gcs->relief = cd->relief_gc;
+ ret_gcs->shadow = cd->shadow_gc;
+ }
+ break;
+ }
return;
}
@@ -1135,12 +1500,13 @@ static void border_draw_x_mark(
}
if (do_draw_shadow)
{
- x1 = x + k;
+ //x1 = x + k;
+ x1 = x;
y1 = y - 1 - k;
}
else
{
- x1 = x;
+ x1 = x - k;
y1 = y + k;
}
x2 = x1 + length;
@@ -1453,7 +1819,7 @@ static void border_get_frame_pixmap(
static void border_get_border_background(
pixmap_background_type *bg, common_decorations_type *cd,
- rectangle *part_g, rectangle *relative_g, int *free_bg_pixmap, Window w)
+ rectangle *part_g, rectangle *relative_g, int *free_bg_pixmap, Window w, window_parts part)
{
*free_bg_pixmap = False;
@@ -1519,9 +1885,38 @@ static void border_get_border_background(
else
{
bg->flags.use_pixmap = 0;
- bg->pixel = cd->attributes.background_pixel;
- }
+ switch ( part )
+ {
+ case PART_BORDER_N:
+ bg->pixel = cd->attributes_north.background_pixel;
+ break;
+ case PART_BORDER_S:
+ bg->pixel = cd->attributes_south.background_pixel;
+ break;
+ case PART_BORDER_E:
+ bg->pixel = cd->attributes_east.background_pixel;
+ break;
+ case PART_BORDER_W:
+ bg->pixel = cd->attributes_west.background_pixel;
+ break;
+ case PART_BORDER_NW:
+ bg->pixel = cd->attributes_nw.background_pixel;
+ break;
+ case PART_BORDER_NE:
+ bg->pixel = cd->attributes_ne.background_pixel;
+ break;
+ case PART_BORDER_SW:
+ bg->pixel = cd->attributes_sw.background_pixel;
+ break;
+ case PART_BORDER_SE:
+ bg->pixel = cd->attributes_se.background_pixel;
+ break;
+ default:
+ bg->pixel = cd->attributes.background_pixel;
+ break;
+ }
+ }
return;
}
@@ -1551,7 +1946,7 @@ static void border_draw_one_border_part(
relative_g.x = part_g.x;
relative_g.y = part_g.y;
border_get_border_background(
- &bg, cd, &part_g, &relative_g, &free_bg_pixmap, w);
+ &bg, cd, &part_g, &relative_g, &free_bg_pixmap, w, part);
if (cd->texture_pixmap)
{
switch (part)
@@ -1638,7 +2033,7 @@ static void border_draw_all_border_parts(
border_get_border_relief_size_descr(&br->relief, fw, do_hilight);
border_get_border_marks_descr(cd, br, fw);
/* fetch the gcs used to draw the border */
- border_get_border_gcs(&br->gcs, cd, fw, do_hilight);
+ //border_get_border_gcs(&br->gcs, cd, fw, do_hilight);
/* draw everything in a big loop */
draw_parts &= (PART_FRAME | PART_HANDLES);
draw_handles = (draw_parts & PART_HANDLES);
@@ -1647,6 +2042,7 @@ static void border_draw_all_border_parts(
{
if (part & draw_parts)
{
+ border_get_border_gcs(&br->gcs, cd, fw, do_hilight, part);
border_draw_one_border_part(
cd, fw, &br->sidebar_g, frame_g, br, part,
draw_handles,
@@ -3279,7 +3675,7 @@ static void border_set_button_pixmap(
relative_g.x = button_g->x;
relative_g.y = button_g->y;
border_get_border_background(
- &bg, td->cd, button_g, &relative_g, &free_bg_pixmap, w);
+ &bg, td->cd, button_g, &relative_g, &free_bg_pixmap, w, PART_NONE);
bg.pixmap.g.x = 0;
bg.pixmap.g.y = 0;
/* set the geometry for drawing the Tiled pixmap;
@@ -3723,7 +4119,7 @@ static void border_set_title_pixmap(
relative_g.y = td->layout.title_g.y;
border_get_border_background(
&bg, td->cd, &td->layout.title_g, &relative_g,
- &free_bg_pixmap, w);
+ &free_bg_pixmap, w, PART_NONE);
bg.pixmap.g.x = 0;
bg.pixmap.g.y = 0;
/* set the geometry for drawing the Tiled pixmap;
diff --git a/fvwm/fvwm.c b/fvwm/fvwm.c
index e4d638b..ef34781 100644
--- a/fvwm/fvwm.c
+++ b/fvwm/fvwm.c
@@ -1086,6 +1086,21 @@ static void CreateGCs(void)
Scr.ScratchGC2 = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv);
Scr.ScratchGC3 = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv);
Scr.ScratchGC4 = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv);
+ Scr.ScratchGC5 = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv);
+ Scr.ScratchGC6 = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv);
+ Scr.ScratchGC7 = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv);
+ Scr.ScratchGC8 = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv);
+ Scr.ScratchGC9 = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv);
+ Scr.ScratchGC10 = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv);
+ Scr.ScratchGC11 = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv);
+ Scr.ScratchGC12 = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv);
+ Scr.ScratchGC13 = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv);
+ Scr.ScratchGC14 = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv);
+ Scr.ScratchGC15 = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv);
+ Scr.ScratchGC16 = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv);
+ Scr.ScratchGC17 = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv);
+ Scr.ScratchGC18 = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv);
+
Scr.TitleGC = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv);
Scr.BordersGC = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv);
Scr.TransMaskGC = fvwmlib_XCreateGC(dpy, Scr.NoFocusWin, gcm, &gcv);
diff --git a/fvwm/fvwm.h b/fvwm/fvwm.h
index 109df1d..c1510b3 100644
--- a/fvwm/fvwm.h
+++ b/fvwm/fvwm.h
@@ -225,6 +225,7 @@ typedef struct
unsigned do_not_show_on_map : 1;
unsigned do_raise_transient : 1;
unsigned do_resize_opaque : 1;
+ unsigned do_resize_outline_thin : 1;
unsigned do_shrink_windowshade : 1;
unsigned do_stack_transient_parent : 1;
unsigned do_window_list_skip : 1;
@@ -577,7 +578,23 @@ typedef struct style_flags
unsigned use_colorset : 1;
unsigned use_colorset_hi : 1;
unsigned use_border_colorset : 1;
+ unsigned use_border_colorset_north : 1;
+ unsigned use_border_colorset_south : 1;
+ unsigned use_border_colorset_east : 1;
+ unsigned use_border_colorset_west : 1;
+ unsigned use_border_colorset_handles_nw : 1;
+ unsigned use_border_colorset_handles_ne : 1;
+ unsigned use_border_colorset_handles_sw : 1;
+ unsigned use_border_colorset_handles_se : 1;
unsigned use_border_colorset_hi : 1;
+ unsigned use_border_colorset_hi_north : 1;
+ unsigned use_border_colorset_hi_south : 1;
+ unsigned use_border_colorset_hi_east : 1;
+ unsigned use_border_colorset_hi_west : 1;
+ unsigned use_border_colorset_hi_handles_nw : 1;
+ unsigned use_border_colorset_hi_handles_ne : 1;
+ unsigned use_border_colorset_hi_handles_sw : 1;
+ unsigned use_border_colorset_hi_handles_se : 1;
unsigned use_icon_title_colorset : 1;
unsigned use_icon_title_colorset_hi : 1;
unsigned use_icon_background_colorset : 1;
@@ -668,7 +685,23 @@ typedef struct window_style
int colorset;
int colorset_hi;
int border_colorset;
+ int border_colorset_north;
+ int border_colorset_south;
+ int border_colorset_east;
+ int border_colorset_west;
+ int border_colorset_handles_nw;
+ int border_colorset_handles_ne;
+ int border_colorset_handles_sw;
+ int border_colorset_handles_se;
int border_colorset_hi;
+ int border_colorset_hi_north;
+ int border_colorset_hi_south;
+ int border_colorset_hi_east;
+ int border_colorset_hi_west;
+ int border_colorset_hi_handles_nw;
+ int border_colorset_hi_handles_ne;
+ int border_colorset_hi_handles_sw;
+ int border_colorset_hi_handles_se;
int icon_title_colorset;
int icon_title_colorset_hi;
int icon_background_colorset;
@@ -883,12 +916,51 @@ typedef struct FvwmWindow
color_quad colors;
color_quad hicolors;
color_quad border_colors;
+ color_quad border_colors_north;
+ color_quad border_colors_south;
+ color_quad border_colors_east;
+ color_quad border_colors_west;
+
+ color_quad border_colors_handles_nw;
+ color_quad border_colors_handles_ne;
+ color_quad border_colors_handles_sw;
+ color_quad border_colors_handles_se;
+
color_quad border_hicolors;
+ color_quad border_hicolors_north;
+ color_quad border_hicolors_south;
+ color_quad border_hicolors_east;
+ color_quad border_hicolors_west;
+
+ color_quad border_hicolors_handles_nw;
+ color_quad border_hicolors_handles_ne;
+ color_quad border_hicolors_handles_sw;
+ color_quad border_hicolors_handles_se;
int cs;
int cs_hi;
int border_cs;
+ int border_cs_north;
+ int border_cs_south;
+ int border_cs_east;
+ int border_cs_west;
+
+ int border_cs_handles_nw;
+ int border_cs_handles_ne;
+ int border_cs_handles_sw;
+ int border_cs_handles_se;
+
int border_cs_hi;
+ int border_cs_hi_north;
+ int border_cs_hi_south;
+ int border_cs_hi_east;
+ int border_cs_hi_west;
+
+ int border_cs_hi_handles_nw;
+ int border_cs_hi_handles_ne;
+ int border_cs_hi_handles_sw;
+ int border_cs_hi_handles_se;
+
int icon_title_cs;
int icon_title_cs_hi;
int icon_background_cs;
diff --git a/fvwm/move_resize.c b/fvwm/move_resize.c
index ac3233d..8f48f38 100644
--- a/fvwm/move_resize.c
+++ b/fvwm/move_resize.c
@@ -108,7 +108,7 @@ static int move_drag_finish_button_mask =
extern Window PressedW;
-static void draw_move_resize_grid(int x, int y, int width, int height);
+static void draw_move_resize_grid(int x, int y, int width, int height, Bool thin);
/* ----- end of resize globals ----- */
@@ -126,26 +126,33 @@ static void draw_move_resize_grid(int x, int y, int width, int height);
*
*/
static int get_outline_rects(
- XRectangle *rects, int x, int y, int width, int height)
+ XRectangle *rects, int x, int y, int width, int height, Bool do_outline_thin)
{
int i;
int n;
int m;
- n = 3;
- m = (width - 5) / 2;
- if (m < n)
+ if (do_outline_thin)
{
- n = m;
- }
- m = (height - 5) / 2;
- if (m < n)
- {
- n = m;
+ n = 1;
}
- if (n < 1)
+ else
{
- n = 1;
+ n = 3;
+ m = (width - 5) / 2;
+ if (m < n)
+ {
+ n = m;
+ }
+ m = (height - 5) / 2;
+ if (m < n)
+ {
+ n = m;
+ }
+ if (n < 1)
+ {
+ n = 1;
+ }
}
for (i = 0; i < n; i++)
@@ -155,25 +162,28 @@ static int get_outline_rects(
rects[i].width = width - (i << 1);
rects[i].height = height - (i << 1);
}
- if (width - (n << 1) >= 5 && height - (n << 1) >= 5)
+ if (!do_outline_thin)
{
- if (width - (n << 1) >= 10)
- {
- int off = (width - (n << 1)) / 3 + n;
- rects[i].x = x + off;
- rects[i].y = y + n;
- rects[i].width = width - (off << 1);
- rects[i].height = height - (n << 1);
- i++;
- }
- if (height - (n << 1) >= 10)
+ if (width - (n << 1) >= 5 && height - (n << 1) >= 5)
{
- int off = (height - (n << 1)) / 3 + n;
- rects[i].x = x + n;
- rects[i].y = y + off;
- rects[i].width = width - (n << 1);
- rects[i].height = height - (off << 1);
- i++;
+ if (width - (n << 1) >= 10)
+ {
+ int off = (width - (n << 1)) / 3 + n;
+ rects[i].x = x + off;
+ rects[i].y = y + n;
+ rects[i].width = width - (off << 1);
+ rects[i].height = height - (n << 1);
+ i++;
+ }
+ if (height - (n << 1) >= 10)
+ {
+ int off = (height - (n << 1)) / 3 + n;
+ rects[i].x = x + n;
+ rects[i].y = y + off;
+ rects[i].width = width - (n << 1);
+ rects[i].height = height - (off << 1);
+ i++;
+ }
}
}
@@ -186,14 +196,15 @@ struct
struct
{
unsigned is_enabled : 1;
+ unsigned do_outline_thin : 1;
} flags;
} move_resize_grid =
{
{ 0, 0, 0, 0 },
- { 0 }
+ { 0, 0 }
};
-static void draw_move_resize_grid(int x, int y, int width, int height)
+static void draw_move_resize_grid(int x, int y, int width, int height, Bool do_outline_thin)
{
int nrects = 0;
XRectangle rects[10];
@@ -202,7 +213,8 @@ static void draw_move_resize_grid(int x, int y, int width, int height)
x == move_resize_grid.geom.x &&
y == move_resize_grid.geom.y &&
width == move_resize_grid.geom.width &&
- height == move_resize_grid.geom.height)
+ height == move_resize_grid.geom.height &&
+ do_outline_thin == move_resize_grid.flags.do_outline_thin)
{
return;
}
@@ -220,7 +232,8 @@ static void draw_move_resize_grid(int x, int y, int width, int height)
&(rects[0]), move_resize_grid.geom.x,
move_resize_grid.geom.y,
move_resize_grid.geom.width,
- move_resize_grid.geom.height);
+ move_resize_grid.geom.height,
+ move_resize_grid.flags.do_outline_thin);
}
if (width && height)
{
@@ -229,8 +242,9 @@ static void draw_move_resize_grid(int x, int y, int width, int height)
move_resize_grid.geom.y = y;
move_resize_grid.geom.width = width;
move_resize_grid.geom.height = height;
+ move_resize_grid.flags.do_outline_thin = do_outline_thin;
nrects += get_outline_rects(
- &(rects[nrects]), x, y, width, height);
+ &(rects[nrects]), x, y, width, height, do_outline_thin);
}
if (nrects > 0)
{
@@ -247,7 +261,7 @@ void switch_move_resize_grid(Bool state)
{
if (move_resize_grid.flags.is_enabled)
{
- draw_move_resize_grid(0, 0, 0, 0);
+ draw_move_resize_grid(0, 0, 0, 0, 0);
}
else
{
@@ -255,6 +269,7 @@ void switch_move_resize_grid(Bool state)
move_resize_grid.geom.y = 0;
move_resize_grid.geom.width = 0;
move_resize_grid.geom.height = 0;
+ move_resize_grid.flags.do_outline_thin = 0;
}
}
else if (!move_resize_grid.flags.is_enabled)
@@ -266,7 +281,8 @@ void switch_move_resize_grid(Bool state)
move_resize_grid.geom.x,
move_resize_grid.geom.y,
move_resize_grid.geom.width,
- move_resize_grid.geom.height);
+ move_resize_grid.geom.height,
+ move_resize_grid.flags.do_outline_thin);
}
}
@@ -2357,6 +2373,7 @@ Bool __move_loop(
/* Must not set placed by button if the event is a modified KeyEvent */
Bool is_fake_event;
FvwmWindow *fw = exc->w.fw;
+ Bool do_outline_thin = DO_RESIZE_OUTLINE_THIN(fw);
unsigned int draw_parts = PART_NONE;
XEvent e;
@@ -2430,7 +2447,7 @@ Bool __move_loop(
if (!IS_ICONIFIED(fw) &&
((!do_move_opaque && !Scr.gs.do_emulate_mwm) || !IS_MAPPED(fw)))
{
- draw_move_resize_grid(xl, yt, Width - 1, Height - 1);
+ draw_move_resize_grid(xl, yt, Width - 1, Height - 1, do_outline_thin);
}
if (move_w == FW_W_FRAME(fw) && do_move_opaque)
@@ -2773,7 +2790,7 @@ Bool __move_loop(
if (!do_move_opaque)
{
draw_move_resize_grid(
- xl, yt, Width - 1, Height - 1);
+ xl, yt, Width - 1, Height - 1, do_outline_thin);
}
else
{
@@ -2849,7 +2866,7 @@ Bool __move_loop(
if (!do_move_opaque)
{
draw_move_resize_grid(
- xl, yt, Width - 1, Height - 1);
+ xl, yt, Width - 1, Height - 1, do_outline_thin);
}
break;
@@ -3469,7 +3486,7 @@ static void __resize_get_refpos(
static void __resize_step(
const exec_context_t *exc, int x_root, int y_root, int *x_off,
int *y_off, rectangle *drag, const rectangle *orig, int *xmotionp,
- int *ymotionp, Bool do_resize_opaque, Bool is_direction_fixed)
+ int *ymotionp, Bool do_resize_opaque, Bool is_direction_fixed, Bool do_outline_thin)
{
int action = 0;
int x2;
@@ -3591,7 +3608,7 @@ static void __resize_step(
{
draw_move_resize_grid(
drag->x, drag->y, drag->width - 1,
- drag->height - 1);
+ drag->height - 1, do_outline_thin);
}
else
{
@@ -3650,6 +3667,7 @@ static Bool __resize_window(F_CMD_ARGS)
int x_off;
int y_off;
direction_t dir;
+ Bool do_outline_thin = DO_RESIZE_OUTLINE_THIN(fw);
int warp_x = 0;
int warp_y = 0;
@@ -3973,7 +3991,7 @@ static Bool __resize_window(F_CMD_ARGS)
if (!do_resize_opaque)
{
draw_move_resize_grid(
- drag->x, drag->y, drag->width - 1, drag->height - 1);
+ drag->x, drag->y, drag->width - 1, drag->height - 1, do_outline_thin);
}
/* kick off resizing without requiring any motion if invoked with a key
* press */
@@ -3994,7 +4012,7 @@ static Bool __resize_window(F_CMD_ARGS)
yo = 0;
__resize_step(
exc, stashed_x, stashed_y, &xo, &yo, drag, orig,
- &xmotion, &ymotion, do_resize_opaque, True);
+ &xmotion, &ymotion, do_resize_opaque, True, do_outline_thin);
}
else
{
@@ -4156,7 +4174,7 @@ static Bool __resize_window(F_CMD_ARGS)