56 |
private int menuBarHeight; |
private int menuBarHeight; |
57 |
private MenuBarPeer menuBar; |
private MenuBarPeer menuBar; |
58 |
native int getMenuBarHeight (MenuBarPeer bar); |
native int getMenuBarHeight (MenuBarPeer bar); |
59 |
|
native void setMenuBarWidthUnlocked (MenuBarPeer bar, int width); |
60 |
native void setMenuBarWidth (MenuBarPeer bar, int width); |
native void setMenuBarWidth (MenuBarPeer bar, int width); |
61 |
native void setMenuBarPeer (MenuBarPeer bar); |
native void setMenuBarPeer (MenuBarPeer bar); |
62 |
native void removeMenuBarPeer (); |
native void removeMenuBarPeer (); |
63 |
native void gtkFixedSetVisible (boolean visible); |
native void gtkFixedSetVisible (boolean visible); |
64 |
|
|
65 |
|
private boolean resizing = false; |
66 |
|
|
67 |
int getMenuBarHeight () |
int getMenuBarHeight () |
68 |
{ |
{ |
69 |
return menuBar == null ? 0 : getMenuBarHeight (menuBar); |
return menuBar == null ? 0 : getMenuBarHeight (menuBar); |
121 |
|
|
122 |
public void setBounds (int x, int y, int width, int height) |
public void setBounds (int x, int y, int width, int height) |
123 |
{ |
{ |
124 |
|
// prevent window_configure_cb -> awtComponent.setSize -> |
125 |
|
// peer.setBounds -> nativeSetBounds self-deadlock on GDK lock. |
126 |
|
if (resizing && Thread.currentThread() == GtkToolkit.mainThread) |
127 |
|
{ |
128 |
|
int menuBarWidth = width - insets.left - insets.right; |
129 |
|
if (menuBar != null && menuBarWidth > 0) |
130 |
|
setMenuBarWidthUnlocked (menuBar, menuBarWidth); |
131 |
|
|
132 |
|
resizing = false; |
133 |
|
return; |
134 |
|
} |
135 |
|
|
136 |
int menuBarWidth = width - insets.left - insets.right; |
int menuBarWidth = width - insets.left - insets.right; |
137 |
if (menuBar != null && menuBarWidth > 0) |
if (menuBar != null && menuBarWidth > 0) |
138 |
setMenuBarWidth (menuBar, menuBarWidth); |
setMenuBarWidth (menuBar, menuBarWidth); |
215 |
|
|
216 |
if (frame_width != awtComponent.getWidth() |
if (frame_width != awtComponent.getWidth() |
217 |
|| frame_height != awtComponent.getHeight()) |
|| frame_height != awtComponent.getHeight()) |
218 |
awtComponent.setSize(frame_width, frame_height); |
{ |
219 |
|
resizing = true; |
220 |
|
awtComponent.setSize(frame_width, frame_height); |
221 |
|
} |
222 |
|
|
223 |
int frame_x = x - insets.left; |
int frame_x = x - insets.left; |
224 |
// Likewise, since insets.top includes the MenuBar height, we need |
// Likewise, since insets.top includes the MenuBar height, we need |