The GPE window manager doesn"t like SetSizeHints().
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@22419 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -32,6 +32,7 @@
|
|||||||
#include "wx/dcclient.h"
|
#include "wx/dcclient.h"
|
||||||
#include "wx/gtk/private.h"
|
#include "wx/gtk/private.h"
|
||||||
#include "wx/timer.h"
|
#include "wx/timer.h"
|
||||||
|
#include "wx/settings.h"
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <gdk/gdk.h>
|
#include <gdk/gdk.h>
|
||||||
@@ -365,8 +366,8 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent,
|
|||||||
m_widget = gtk_window_new( win_type );
|
m_widget = gtk_window_new( win_type );
|
||||||
|
|
||||||
if (m_parent && (((GTK_IS_WINDOW(m_parent->m_widget)) &&
|
if (m_parent && (((GTK_IS_WINDOW(m_parent->m_widget)) &&
|
||||||
(GetExtraStyle() & wxTOPLEVEL_EX_DIALOG)) ||
|
(GetExtraStyle() & wxTOPLEVEL_EX_DIALOG)) ||
|
||||||
(style & wxFRAME_FLOAT_ON_PARENT)))
|
(style & wxFRAME_FLOAT_ON_PARENT)))
|
||||||
{
|
{
|
||||||
gtk_window_set_transient_for( GTK_WINDOW(m_widget), GTK_WINDOW(m_parent->m_widget) );
|
gtk_window_set_transient_for( GTK_WINDOW(m_widget), GTK_WINDOW(m_parent->m_widget) );
|
||||||
}
|
}
|
||||||
@@ -519,8 +520,8 @@ bool wxTopLevelWindowGTK::ShowFullScreen(bool show, long style )
|
|||||||
int screen_width,screen_height;
|
int screen_width,screen_height;
|
||||||
wxDisplaySize( &screen_width, &screen_height );
|
wxDisplaySize( &screen_width, &screen_height );
|
||||||
|
|
||||||
gint client_x, client_y, root_x, root_y;
|
gint client_x, client_y, root_x, root_y;
|
||||||
gint width, height;
|
gint width, height;
|
||||||
|
|
||||||
if (method != wxX11_FS_WMSPEC)
|
if (method != wxX11_FS_WMSPEC)
|
||||||
{
|
{
|
||||||
@@ -532,12 +533,12 @@ bool wxTopLevelWindowGTK::ShowFullScreen(bool show, long style )
|
|||||||
gdk_window_set_functions(window, (GdkWMFunction)0);
|
gdk_window_set_functions(window, (GdkWMFunction)0);
|
||||||
}
|
}
|
||||||
|
|
||||||
gdk_window_get_origin (m_widget->window, &root_x, &root_y);
|
gdk_window_get_origin (m_widget->window, &root_x, &root_y);
|
||||||
gdk_window_get_geometry (m_widget->window, &client_x, &client_y,
|
gdk_window_get_geometry (m_widget->window, &client_x, &client_y,
|
||||||
&width, &height, NULL);
|
&width, &height, NULL);
|
||||||
|
|
||||||
gdk_window_move_resize (m_widget->window, -client_x, -client_y,
|
gdk_window_move_resize (m_widget->window, -client_x, -client_y,
|
||||||
screen_width + 1, screen_height + 1);
|
screen_width + 1, screen_height + 1);
|
||||||
|
|
||||||
wxSetFullScreenStateX11((WXDisplay*)GDK_DISPLAY(),
|
wxSetFullScreenStateX11((WXDisplay*)GDK_DISPLAY(),
|
||||||
(WXWindow)GDK_ROOT_WINDOW(),
|
(WXWindow)GDK_ROOT_WINDOW(),
|
||||||
@@ -711,18 +712,29 @@ void wxTopLevelWindowGTK::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
|
|||||||
m_width = width;
|
m_width = width;
|
||||||
m_height = height;
|
m_height = height;
|
||||||
|
|
||||||
/* wxMDIChildFrame derives from wxFrame but it _is_ a wxWindow as it uses
|
// wxMDIChildFrame derives from wxFrame but it _is_ a wxWindow as it uses
|
||||||
wxWindow::Create to create it's GTK equivalent. m_mainWidget is only
|
// wxWindow::Create to create it's GTK equivalent. m_mainWidget is only
|
||||||
set in wxFrame::Create so it is used to check what kind of frame we
|
// set in wxFrame::Create so it is used to check what kind of frame we
|
||||||
have here. if m_mainWidget is NULL it is a wxMDIChildFrame and so we
|
// have here. if m_mainWidget is NULL it is a wxMDIChildFrame and so we
|
||||||
skip the part which handles m_frameMenuBar, m_frameToolBar and (most
|
// skip the part which handles m_frameMenuBar, m_frameToolBar and (most
|
||||||
importantly) m_mainWidget */
|
// importantly) m_mainWidget
|
||||||
|
|
||||||
int minWidth = GetMinWidth(),
|
int minWidth = GetMinWidth(),
|
||||||
minHeight = GetMinHeight(),
|
minHeight = GetMinHeight(),
|
||||||
maxWidth = GetMaxWidth(),
|
maxWidth = GetMaxWidth(),
|
||||||
maxHeight = GetMaxHeight();
|
maxHeight = GetMaxHeight();
|
||||||
|
|
||||||
|
if (wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA)
|
||||||
|
{
|
||||||
|
// GPE's window manager doesn't like size hints
|
||||||
|
// at all, esp. when the user has to use the
|
||||||
|
// virtual keyboard.
|
||||||
|
minWidth = -1;
|
||||||
|
minHeight = -1;
|
||||||
|
maxWidth = -1;
|
||||||
|
maxHeight = -1;
|
||||||
|
}
|
||||||
|
|
||||||
if ((minWidth != -1) && (m_width < minWidth)) m_width = minWidth;
|
if ((minWidth != -1) && (m_width < minWidth)) m_width = minWidth;
|
||||||
if ((minHeight != -1) && (m_height < minHeight)) m_height = minHeight;
|
if ((minHeight != -1) && (m_height < minHeight)) m_height = minHeight;
|
||||||
if ((maxWidth != -1) && (m_width > maxWidth)) m_width = maxWidth;
|
if ((maxWidth != -1) && (m_width > maxWidth)) m_width = maxWidth;
|
||||||
|
@@ -32,6 +32,7 @@
|
|||||||
#include "wx/dcclient.h"
|
#include "wx/dcclient.h"
|
||||||
#include "wx/gtk/private.h"
|
#include "wx/gtk/private.h"
|
||||||
#include "wx/timer.h"
|
#include "wx/timer.h"
|
||||||
|
#include "wx/settings.h"
|
||||||
|
|
||||||
#include <glib.h>
|
#include <glib.h>
|
||||||
#include <gdk/gdk.h>
|
#include <gdk/gdk.h>
|
||||||
@@ -365,8 +366,8 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent,
|
|||||||
m_widget = gtk_window_new( win_type );
|
m_widget = gtk_window_new( win_type );
|
||||||
|
|
||||||
if (m_parent && (((GTK_IS_WINDOW(m_parent->m_widget)) &&
|
if (m_parent && (((GTK_IS_WINDOW(m_parent->m_widget)) &&
|
||||||
(GetExtraStyle() & wxTOPLEVEL_EX_DIALOG)) ||
|
(GetExtraStyle() & wxTOPLEVEL_EX_DIALOG)) ||
|
||||||
(style & wxFRAME_FLOAT_ON_PARENT)))
|
(style & wxFRAME_FLOAT_ON_PARENT)))
|
||||||
{
|
{
|
||||||
gtk_window_set_transient_for( GTK_WINDOW(m_widget), GTK_WINDOW(m_parent->m_widget) );
|
gtk_window_set_transient_for( GTK_WINDOW(m_widget), GTK_WINDOW(m_parent->m_widget) );
|
||||||
}
|
}
|
||||||
@@ -519,8 +520,8 @@ bool wxTopLevelWindowGTK::ShowFullScreen(bool show, long style )
|
|||||||
int screen_width,screen_height;
|
int screen_width,screen_height;
|
||||||
wxDisplaySize( &screen_width, &screen_height );
|
wxDisplaySize( &screen_width, &screen_height );
|
||||||
|
|
||||||
gint client_x, client_y, root_x, root_y;
|
gint client_x, client_y, root_x, root_y;
|
||||||
gint width, height;
|
gint width, height;
|
||||||
|
|
||||||
if (method != wxX11_FS_WMSPEC)
|
if (method != wxX11_FS_WMSPEC)
|
||||||
{
|
{
|
||||||
@@ -532,12 +533,12 @@ bool wxTopLevelWindowGTK::ShowFullScreen(bool show, long style )
|
|||||||
gdk_window_set_functions(window, (GdkWMFunction)0);
|
gdk_window_set_functions(window, (GdkWMFunction)0);
|
||||||
}
|
}
|
||||||
|
|
||||||
gdk_window_get_origin (m_widget->window, &root_x, &root_y);
|
gdk_window_get_origin (m_widget->window, &root_x, &root_y);
|
||||||
gdk_window_get_geometry (m_widget->window, &client_x, &client_y,
|
gdk_window_get_geometry (m_widget->window, &client_x, &client_y,
|
||||||
&width, &height, NULL);
|
&width, &height, NULL);
|
||||||
|
|
||||||
gdk_window_move_resize (m_widget->window, -client_x, -client_y,
|
gdk_window_move_resize (m_widget->window, -client_x, -client_y,
|
||||||
screen_width + 1, screen_height + 1);
|
screen_width + 1, screen_height + 1);
|
||||||
|
|
||||||
wxSetFullScreenStateX11((WXDisplay*)GDK_DISPLAY(),
|
wxSetFullScreenStateX11((WXDisplay*)GDK_DISPLAY(),
|
||||||
(WXWindow)GDK_ROOT_WINDOW(),
|
(WXWindow)GDK_ROOT_WINDOW(),
|
||||||
@@ -711,18 +712,29 @@ void wxTopLevelWindowGTK::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y),
|
|||||||
m_width = width;
|
m_width = width;
|
||||||
m_height = height;
|
m_height = height;
|
||||||
|
|
||||||
/* wxMDIChildFrame derives from wxFrame but it _is_ a wxWindow as it uses
|
// wxMDIChildFrame derives from wxFrame but it _is_ a wxWindow as it uses
|
||||||
wxWindow::Create to create it's GTK equivalent. m_mainWidget is only
|
// wxWindow::Create to create it's GTK equivalent. m_mainWidget is only
|
||||||
set in wxFrame::Create so it is used to check what kind of frame we
|
// set in wxFrame::Create so it is used to check what kind of frame we
|
||||||
have here. if m_mainWidget is NULL it is a wxMDIChildFrame and so we
|
// have here. if m_mainWidget is NULL it is a wxMDIChildFrame and so we
|
||||||
skip the part which handles m_frameMenuBar, m_frameToolBar and (most
|
// skip the part which handles m_frameMenuBar, m_frameToolBar and (most
|
||||||
importantly) m_mainWidget */
|
// importantly) m_mainWidget
|
||||||
|
|
||||||
int minWidth = GetMinWidth(),
|
int minWidth = GetMinWidth(),
|
||||||
minHeight = GetMinHeight(),
|
minHeight = GetMinHeight(),
|
||||||
maxWidth = GetMaxWidth(),
|
maxWidth = GetMaxWidth(),
|
||||||
maxHeight = GetMaxHeight();
|
maxHeight = GetMaxHeight();
|
||||||
|
|
||||||
|
if (wxSystemSettings::GetScreenType() <= wxSYS_SCREEN_PDA)
|
||||||
|
{
|
||||||
|
// GPE's window manager doesn't like size hints
|
||||||
|
// at all, esp. when the user has to use the
|
||||||
|
// virtual keyboard.
|
||||||
|
minWidth = -1;
|
||||||
|
minHeight = -1;
|
||||||
|
maxWidth = -1;
|
||||||
|
maxHeight = -1;
|
||||||
|
}
|
||||||
|
|
||||||
if ((minWidth != -1) && (m_width < minWidth)) m_width = minWidth;
|
if ((minWidth != -1) && (m_width < minWidth)) m_width = minWidth;
|
||||||
if ((minHeight != -1) && (m_height < minHeight)) m_height = minHeight;
|
if ((minHeight != -1) && (m_height < minHeight)) m_height = minHeight;
|
||||||
if ((maxWidth != -1) && (m_width > maxWidth)) m_width = maxWidth;
|
if ((maxWidth != -1) && (m_width > maxWidth)) m_width = maxWidth;
|
||||||
|
Reference in New Issue
Block a user