diff --git a/gb.gtk/src/CScreen.cpp b/gb.gtk/src/CScreen.cpp index 6ab603af9..7d954c760 100644 --- a/gb.gtk/src/CScreen.cpp +++ b/gb.gtk/src/CScreen.cpp @@ -290,13 +290,6 @@ BEGIN_PROPERTY(Screens_Count) END_PROPERTY -BEGIN_PROPERTY(Screens_Primary) - - GB.ReturnInteger(gDesktop::primary()); - -END_PROPERTY - - BEGIN_METHOD(Screens_get, GB_INTEGER screen) GB.ReturnObject(get_screen(VARG(screen))); @@ -396,8 +389,6 @@ GB_DESC ScreensDesc[] = GB_STATIC_METHOD("_get", "Screen", Screens_get, "(Screen)i"), GB_STATIC_METHOD("_next", "Screen", Screens_next, NULL), - GB_STATIC_PROPERTY_READ("Primary", "i", Screens_Primary), - GB_END_DECLARE }; diff --git a/gb.gtk/src/gdesktop.cpp b/gb.gtk/src/gdesktop.cpp index 5557775c1..7f5835481 100644 --- a/gb.gtk/src/gdesktop.cpp +++ b/gb.gtk/src/gdesktop.cpp @@ -349,11 +349,6 @@ int gDesktop::count() #endif } -int gDesktop::primary() -{ - return gdk_screen_get_number(gdk_screen_get_default()); -} - void gDesktop::geometry(int screen, GdkRectangle *rect) { rect->x = rect->y = rect->width = rect->height = 0; diff --git a/gb.gtk/src/gdesktop.h b/gb.gtk/src/gdesktop.h index 31b86edac..bb2eefe1c 100644 --- a/gb.gtk/src/gdesktop.h +++ b/gb.gtk/src/gdesktop.h @@ -63,7 +63,6 @@ public: static bool rightToLeft(); static int count(); - static int primary(); static void geometry(int screen, GdkRectangle *rect); static void availableGeometry(int screen, GdkRectangle *rect); diff --git a/gb.qt4/src/CScreen.cpp b/gb.qt4/src/CScreen.cpp index 2b595db3c..1c317f300 100644 --- a/gb.qt4/src/CScreen.cpp +++ b/gb.qt4/src/CScreen.cpp @@ -305,11 +305,11 @@ BEGIN_PROPERTY(Screens_Count) END_PROPERTY -BEGIN_PROPERTY(Screens_Primary) +/*BEGIN_PROPERTY(Screens_Primary) GB.ReturnInteger(QApplication::desktop()->primaryScreen()); -END_PROPERTY +END_PROPERTY*/ BEGIN_METHOD(Screens_get, GB_INTEGER screen) @@ -412,8 +412,6 @@ GB_DESC ScreensDesc[] = GB_STATIC_METHOD("_get", "Screen", Screens_get, "(Screen)i"), GB_STATIC_METHOD("_next", "Screen", Screens_next, NULL), - GB_STATIC_PROPERTY_READ("Primary", "i", Screens_Primary), - GB_END_DECLARE }; diff --git a/gb.qt4/src/CWindow.cpp b/gb.qt4/src/CWindow.cpp index e1578f764..1509d4564 100644 --- a/gb.qt4/src/CWindow.cpp +++ b/gb.qt4/src/CWindow.cpp @@ -1512,12 +1512,10 @@ MyMainWindow::~MyMainWindow() if (CWINDOW_Active == THIS) CWINDOW_Active = 0; + if (CWINDOW_LastActive == THIS) - { CWINDOW_LastActive = 0; - //qDebug("CWINDOW_LastActive = 0"); - } - + if (sg) delete sg; @@ -1646,7 +1644,13 @@ void MyMainWindow::present(QWidget *parent) { if (parent) _screen = QApplication::desktop()->screenNumber(parent); - + else if (CWINDOW_Active) + _screen = QApplication::desktop()->screenNumber(CWINDOW_Active->widget.widget); + else if (CWINDOW_Main) + _screen = QApplication::desktop()->screenNumber(CWINDOW_Main->widget.widget); + else + _screen = 0; + if (!isVisible()) { //X11_window_startup(WINDOW->effectiveWinId(), THIS->x, THIS->y, THIS->w, THIS->h); @@ -1742,7 +1746,6 @@ void MyMainWindow::showActivate(QWidget *transient) present(newParentWidget); setEventLoop(); - } void on_error_show_modal(MODAL_INFO *info) @@ -1801,7 +1804,7 @@ void MyMainWindow::showModal(void) _enterLoop = false; // Do not call exitLoop() if we do not entered the loop yet! - present(CWINDOW_Active ? CWidget::getTopLevel((CWIDGET *)CWINDOW_Active)->widget.widget : 0); + present(CWINDOW_Current ? CWidget::getTopLevel((CWIDGET *)CWINDOW_Current)->widget.widget : 0); setEventLoop(); THIS->loopLevel++;