2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
|
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
|
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
|
} else {
int width, height, w, h;
width = LOWORD(lParam);
height = HIWORD(lParam);
if (!resizing) {
if (wParam == SIZE_MAXIMIZED && !was_zoomed) {
was_zoomed = 1;
prev_rows = term->rows;
prev_cols = term->cols;
if (cfg.resize_action == RESIZE_TERM) {
w = width / font_width;
if (w < 1) w = 1;
h = height / font_height;
if (h < 1) h = 1;
if (wParam == SIZE_MAXIMIZED && !was_zoomed) {
was_zoomed = 1;
prev_rows = term->rows;
prev_cols = term->cols;
if (cfg.resize_action == RESIZE_TERM) {
w = width / font_width;
if (w < 1) w = 1;
h = height / font_height;
if (h < 1) h = 1;
term_size(term, h, w, cfg.savelines);
}
reset_window(0);
} else if (wParam == SIZE_RESTORED && was_zoomed) {
was_zoomed = 0;
if (cfg.resize_action == RESIZE_TERM)
term_size(term, prev_rows, prev_cols, cfg.savelines);
if (cfg.resize_action != RESIZE_FONT)
reset_window(2);
else
reset_window(0);
}
/* This is an unexpected resize, these will normally happen
* if the window is too large. Probably either the user
* selected a huge font or the screen size has changed.
term_size(term, h, w, cfg.savelines);
}
reset_window(0);
} else if (wParam == SIZE_RESTORED && was_zoomed) {
was_zoomed = 0;
if (cfg.resize_action == RESIZE_TERM)
term_size(term, prev_rows, prev_cols, cfg.savelines);
if (cfg.resize_action != RESIZE_FONT)
reset_window(2);
else
reset_window(0);
} else if (wParam == SIZE_MINIMIZED) {
/* do nothing */
} else if (cfg.resize_action != RESIZE_FONT && !is_alt_pressed()) {
w = (width-cfg.window_border*2) / font_width;
*
* This is also called with minimize.
*/
else reset_window(-1);
}
/*
* Don't call back->size in mid-resize. (To prevent
* massive numbers of resize events getting sent
* down the connection during an NT opaque drag.)
*/
if (w < 1) w = 1;
h = (height-cfg.window_border*2) / font_height;
if (h < 1) h = 1;
if (resizing) {
/*
* Don't call back->size in mid-resize. (To
* prevent massive numbers of resize events
* getting sent down the connection during an NT
* opaque drag.)
*/
if (resizing) {
if (cfg.resize_action != RESIZE_FONT && !is_alt_pressed()) {
need_backend_resize = TRUE;
w = (width-cfg.window_border*2) / font_width;
if (w < 1) w = 1;
h = (height-cfg.window_border*2) / font_height;
if (h < 1) h = 1;
cfg.height = h;
cfg.width = w;
} else
reset_window(0);
} else {
term_size(term, h, w, cfg.savelines);
}
} else {
reset_window(0);
}
}
sys_cursor_update();
return 0;
case WM_VSCROLL:
switch (LOWORD(wParam)) {
case SB_BOTTOM:
|