< prev index next >

modules/javafx.graphics/src/main/native-glass/gtk/glass_window.cpp

Print this page




1159 void WindowContextTop::process_map() {
1160     map_received = true;
1161 }
1162 
1163 void WindowContextTop::window_configure(XWindowChanges *windowChanges,
1164         unsigned int windowChangesMask) {
1165     if (windowChangesMask == 0) {
1166         return;
1167     }
1168 
1169     if (windowChangesMask & (CWX | CWY)) {
1170         gint newX, newY;
1171         gtk_window_get_position(GTK_WINDOW(gtk_widget), &newX, &newY);
1172 
1173         if (windowChangesMask & CWX) {
1174             newX = windowChanges->x;
1175         }
1176         if (windowChangesMask & CWY) {
1177             newY = windowChanges->y;
1178         }
1179 
1180         gtk_window_move(GTK_WINDOW(gtk_widget), newX, newY);
1181     }
1182 
1183     if (windowChangesMask & (CWWidth | CWHeight)) {
1184         gint newWidth, newHeight;
1185         gtk_window_get_size(GTK_WINDOW(gtk_widget), &newWidth, &newHeight);
1186 
1187         if (windowChangesMask & CWWidth) {
1188             newWidth = windowChanges->width;
1189         }
1190         if (windowChangesMask & CWHeight) {
1191             newHeight = windowChanges->height;
1192         }
1193 
1194         if (!resizable.value) {
1195             GdkGeometry geom;
1196             GdkWindowHints hints = (GdkWindowHints)(GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE);
1197             geom.min_width = geom.max_width = newWidth;
1198             geom.min_height = geom.max_height = newHeight;
1199             gtk_window_set_geometry_hints(GTK_WINDOW(gtk_widget), NULL, &geom, hints);
1200         }
1201         gtk_window_resize(GTK_WINDOW(gtk_widget), newWidth, newHeight);
1202     }
1203 }
1204 
1205 void WindowContextTop::applyShapeMask(void* data, uint width, uint height)
1206 {
1207     if (frame_type != TRANSPARENT) {
1208         return;
1209     }
1210 
1211     glass_window_apply_shape_mask(gtk_widget_get_window(gtk_widget), data, width, height);
1212 }
1213 
1214 void WindowContextTop::set_minimized(bool minimize) {
1215     is_iconified = minimize;
1216     if (minimize) {
1217         if (frame_type == TRANSPARENT) {
1218             // https://bugs.launchpad.net/ubuntu/+source/unity/+bug/1245571
1219             glass_window_reset_input_shape_mask(gtk_widget_get_window(gtk_widget));
1220         }
1221 




1159 void WindowContextTop::process_map() {
1160     map_received = true;
1161 }
1162 
1163 void WindowContextTop::window_configure(XWindowChanges *windowChanges,
1164         unsigned int windowChangesMask) {
1165     if (windowChangesMask == 0) {
1166         return;
1167     }
1168 
1169     if (windowChangesMask & (CWX | CWY)) {
1170         gint newX, newY;
1171         gtk_window_get_position(GTK_WINDOW(gtk_widget), &newX, &newY);
1172 
1173         if (windowChangesMask & CWX) {
1174             newX = windowChanges->x;
1175         }
1176         if (windowChangesMask & CWY) {
1177             newY = windowChanges->y;
1178         }
1179         gdk_window_move(gdk_window, newX, newY);

1180     }
1181 
1182     if (windowChangesMask & (CWWidth | CWHeight)) {
1183         gint newWidth, newHeight;
1184         gtk_window_get_size(GTK_WINDOW(gtk_widget), &newWidth, &newHeight);
1185 
1186         if (windowChangesMask & CWWidth) {
1187             newWidth = windowChanges->width;
1188         }
1189         if (windowChangesMask & CWHeight) {
1190             newHeight = windowChanges->height;
1191         }
1192 
1193         if (!resizable.value) {
1194             GdkGeometry geom;
1195             GdkWindowHints hints = (GdkWindowHints)(GDK_HINT_MIN_SIZE | GDK_HINT_MAX_SIZE);
1196             geom.min_width = geom.max_width = newWidth;
1197             geom.min_height = geom.max_height = newHeight;
1198             gtk_window_set_geometry_hints(GTK_WINDOW(gtk_widget), NULL, &geom, hints);
1199         }
1200         gdk_window_resize(gdk_window, newWidth, newHeight);
1201     }
1202 }
1203 
1204 void WindowContextTop::applyShapeMask(void* data, uint width, uint height)
1205 {
1206     if (frame_type != TRANSPARENT) {
1207         return;
1208     }
1209 
1210     glass_window_apply_shape_mask(gtk_widget_get_window(gtk_widget), data, width, height);
1211 }
1212 
1213 void WindowContextTop::set_minimized(bool minimize) {
1214     is_iconified = minimize;
1215     if (minimize) {
1216         if (frame_type == TRANSPARENT) {
1217             // https://bugs.launchpad.net/ubuntu/+source/unity/+bug/1245571
1218             glass_window_reset_input_shape_mask(gtk_widget_get_window(gtk_widget));
1219         }
1220 


< prev index next >