FreeCalypso > hg > freecalypso-sw
comparison lcdemu/window.c @ 904:e54abee27e8f
lcdemu: window size hints set correctly
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Mon, 07 Sep 2015 08:43:30 +0000 |
parents | 312778104f54 |
children |
comparison
equal
deleted
inserted
replaced
903:312778104f54 | 904:e54abee27e8f |
---|---|
3 * X11 window creation functions | 3 * X11 window creation functions |
4 */ | 4 */ |
5 | 5 |
6 #include <stdio.h> | 6 #include <stdio.h> |
7 #include <stdlib.h> | 7 #include <stdlib.h> |
8 #include <string.h> | |
9 #include <strings.h> | |
8 #include <X11/Xlib.h> | 10 #include <X11/Xlib.h> |
9 #include <X11/Xresource.h> | 11 #include <X11/Xresource.h> |
10 #include <X11/Xutil.h> | 12 #include <X11/Xutil.h> |
11 #include "globals.h" | 13 #include "globals.h" |
12 | 14 |
21 XSetWindowAttributes xswa; | 23 XSetWindowAttributes xswa; |
22 u_long xswamask; | 24 u_long xswamask; |
23 XColor bdcolor; | 25 XColor bdcolor; |
24 XClassHint xclasshint; | 26 XClassHint xclasshint; |
25 XWMHints wmhints; | 27 XWMHints wmhints; |
28 XSizeHints wm_normal_hints; | |
26 | 29 |
27 /* Determine our geometry */ | 30 /* Determine our geometry */ |
28 instquarks[0] = xrmquark_topinstance; | 31 instquarks[0] = xrmquark_topinstance; |
29 classquarks[0] = xrmquark_topclass; | 32 classquarks[0] = xrmquark_topclass; |
30 classquarks[1] = instquarks[1] = XrmStringToQuark("geometry"); | 33 classquarks[1] = instquarks[1] = XrmStringToQuark("geometry"); |
94 free(cp); | 97 free(cp); |
95 } else | 98 } else |
96 i = 0; | 99 i = 0; |
97 wmhints.initial_state = i ? IconicState : NormalState; | 100 wmhints.initial_state = i ? IconicState : NormalState; |
98 XSetWMHints(mydisplay, mainwindow, &wmhints); | 101 XSetWMHints(mydisplay, mainwindow, &wmhints); |
99 #if 0 | |
100 if (geomask & (WidthValue|HeightValue)) | 102 if (geomask & (WidthValue|HeightValue)) |
101 wm_normal_hints.flags = USSize; | 103 wm_normal_hints.flags = USSize; |
102 else | 104 else |
103 wm_normal_hints.flags = PSize; | 105 wm_normal_hints.flags = PSize; |
104 if (geomask & (XValue|YValue)) | 106 if (geomask & (XValue|YValue)) |
105 wm_normal_hints.flags |= USPosition; | 107 wm_normal_hints.flags |= USPosition; |
106 set_wm_normal_hints(); | |
107 #endif | |
108 } | |
109 | |
110 #if 0 | |
111 set_wm_normal_hints() | |
112 { | |
113 wm_normal_hints.min_width = MIN_COLUMNS * charcell_width; | |
114 wm_normal_hints.min_height = MIN_LINES * charcell_height; | |
115 wm_normal_hints.max_width = MAX_COLUMNS * charcell_width; | |
116 wm_normal_hints.max_height = MAX_LINES * charcell_height; | |
117 wm_normal_hints.width_inc = charcell_width; | |
118 wm_normal_hints.height_inc = charcell_height; | |
119 wm_normal_hints.base_width = 0; | |
120 wm_normal_hints.base_height = 0; | |
121 wm_normal_hints.flags |= PMinSize | PMaxSize | PResizeInc | PBaseSize; | |
122 XSetWMNormalHints(mydisplay, mainwindow, &wm_normal_hints); | 108 XSetWMNormalHints(mydisplay, mainwindow, &wm_normal_hints); |
123 } | 109 } |
124 #endif | |
125 | 110 |
126 set_initial_window_title() | 111 set_initial_window_title() |
127 { | 112 { |
128 XrmQuark instquarks[3], classquarks[3]; | 113 XrmQuark instquarks[3], classquarks[3]; |
129 register char *cp; | 114 register char *cp; |