Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions main/vcl/inc/unx/gtk/gtkdata.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
#include <unx/saldata.hxx>
#include <vcl/ptrstyle.hxx>

#include <list>

class GtkData : public X11SalData
{
public:
Expand All @@ -55,7 +53,6 @@ class GtkSalDisplay : public SalDisplay
GdkDisplay* m_pGdkDisplay;
GdkCursor *m_aCursors[ POINTER_COUNT ];
bool m_bStartupCompleted;
std::vector< int > m_aXineramaScreenIndexMap;

GdkCursor* getFromXPM( const char *pBitmap, const char *pMask,
int nWidth, int nHeight, int nXHot, int nYHot );
Expand Down
1 change: 0 additions & 1 deletion main/vcl/inc/unx/gtk/gtkgdi.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
#include <tools/prex.h>
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
#include <gdk/gdkkeysyms.h>
#include <tools/postx.h>

#include <unx/salgdi.h>
Expand Down
70 changes: 4 additions & 66 deletions main/vcl/unx/gtk/app/gtkdata.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -202,78 +202,16 @@ void GtkSalDisplay::screenSizeChanged( GdkScreen* pScreen )

void GtkSalDisplay::monitorsChanged( GdkScreen* pScreen )
{
/* Caution: since we support the _NET_WM_FULLSCREEN_MONITORS property now and
the EWMH spec says, the index used for that needs to be that of the
Xinerama extension, we need to ensure that the order of m_aXineramaScreens is actually intact.

gdk_screen_get_monitor_geometry however has a different sort order that has a default monitor number
Xinerama returns the default monitor as 0.
That means if we fill in the multiple monitors vector from gdk, we'll get the wrong order unless
the default monitor is incidentally the same (number 0).

Given that XRandR (which is what gdk_screen_get_monitor_geometry is based on) is
supposed to replace Xinerama, this is bound to get a problem at some time again,
unfortunately there does not currently seem to be a way to map the returns of xinerama to
that of randr. Currently getting Xinerama values again works with updated values, given
a new enough Xserver.
*/

InitXinerama();
(void)pScreen;

#if 0
if( pScreen )
{
if( gdk_display_get_n_screens(m_pGdkDisplay) == 1 )
{
int nScreen = gdk_screen_get_number( pScreen );
if( nScreen == m_nDefaultScreen ) //To-Do, make m_aXineramaScreens a per-screen thing ?
{
gint nMonitors = gdk_screen_get_n_monitors(pScreen);
m_aXineramaScreens = std::vector<Rectangle>();
m_aXineramaScreenIndexMap = std::vector<int>(nMonitors);
for (gint i = 0; i < nMonitors; ++i)
{
GdkRectangle dest;
gdk_screen_get_monitor_geometry(pScreen, i, &dest);
m_aXineramaScreenIndexMap[i] = addXineramaScreenUnique( dest.x, dest.y, dest.width, dest.height );
}
m_bXinerama = m_aXineramaScreens.size() > 1;
if( ! m_aFrames.empty() )
m_aFrames.front()->CallCallback( SALEVENT_DISPLAYCHANGED, 0 );
}
else
{
DBG_ERROR( "monitors for non-default screen changed, extend-me" );
}
}
}
#endif
}

extern "C"
{
typedef gint(* screen_get_primary_monitor)(GdkScreen *screen);
}

int GtkSalDisplay::GetDefaultMonitorNumber() const
{
int n = 0;

// currently disabled, see remarks in monitorsChanged
#if 0
GdkScreen* pScreen = gdk_display_get_screen( m_pGdkDisplay, m_nDefaultScreen );
#if GTK_CHECK_VERSION(2,20,0)
n = gdk_screen_get_primary_monitor(pScreen);
#else
static screen_get_primary_monitor sym_gdk_screen_get_primary_monitor =
(screen_get_primary_monitor)osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gdk_screen_get_primary_monitor" );
if (sym_gdk_screen_get_primary_monitor)
n = sym_gdk_screen_get_primary_monitor( pScreen );
#endif
if( n >= 0 && size_t(n) < m_aXineramaScreenIndexMap.size() )
n = m_aXineramaScreenIndexMap[n];
#endif
return n;
// GTK's primary-monitor implementation is disabled; use the
// Xinerama default monitor.
return 0;
}

void GtkSalDisplay::initScreen( int nScreen ) const
Expand Down
18 changes: 0 additions & 18 deletions main/vcl/unx/gtk/app/gtkinst.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -205,12 +205,6 @@ SalObject* GtkInstance::CreateObject( SalFrame* pParent, SystemWindowData* pWind
return new GtkSalObject( static_cast<GtkSalFrame*>(pParent), bShow );
}

extern "C"
{
typedef void*(* getDefaultFnc)();
typedef void(* addItemFnc)(void *, const char *);
}

void GtkInstance::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const rtl::OUString& rMimeType)
{
rtl::OString sGtkURL;
Expand All @@ -229,21 +223,9 @@ void GtkInstance::AddToRecentDocumentList(const rtl::OUString& rFileUrl, const r
sGtkURL = rtl::OString(g_uri);
g_free(g_uri);
}
#if GTK_CHECK_VERSION(2,10,0)
GtkRecentManager *manager = gtk_recent_manager_get_default ();
gtk_recent_manager_add_item( manager, sGtkURL.getStr());
(void)rMimeType;
#else
static getDefaultFnc sym_gtk_recent_manager_get_default =
(getDefaultFnc)osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gtk_recent_manager_get_default" );

static addItemFnc sym_gtk_recent_manager_add_item =
(addItemFnc)osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gtk_recent_manager_add_item");
if (sym_gtk_recent_manager_get_default && sym_gtk_recent_manager_add_item)
sym_gtk_recent_manager_add_item(sym_gtk_recent_manager_get_default(), sGtkURL);
else
X11SalInstance::AddToRecentDocumentList(rFileUrl, rMimeType);
#endif
}

GtkYieldMutex::GtkYieldMutex()
Expand Down
8 changes: 1 addition & 7 deletions main/vcl/unx/gtk/gdi/salnativewidgets-gtk.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3580,13 +3580,7 @@ void GtkSalGraphics::updateSettings( AllSettings& rSettings )
const cairo_font_options_t* pNewOptions = NULL;
if( GdkScreen* pScreen = gdk_display_get_screen( gdk_display_get_default(), m_nScreen ) )
{
//#if !GTK_CHECK_VERSION(2,8,1)
#if !GTK_CHECK_VERSION(2,9,0)
static cairo_font_options_t* (*gdk_screen_get_font_options)(GdkScreen*) =
(cairo_font_options_t*(*)(GdkScreen*))osl_getAsciiFunctionSymbol( GetSalData()->m_pPlugin, "gdk_screen_get_font_options" );
if( gdk_screen_get_font_options != NULL )
#endif
pNewOptions = gdk_screen_get_font_options( pScreen );
pNewOptions = gdk_screen_get_font_options( pScreen );
}
aStyleSet.SetCairoFontOptions( pNewOptions );

Expand Down
7 changes: 0 additions & 7 deletions main/vcl/unx/gtk/window/gtkframe.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,6 @@
#define GSM_DBUS_INTERFACE "org.gnome.SessionManager"
#endif

// make compile on gtk older than 2.10
#if GTK_MINOR_VERSION < 10
#define GDK_SUPER_MASK (1 << 26)
#define GDK_HYPER_MASK (1 << 27)
#define GDK_META_MASK (1 << 28)
#endif

using namespace com::sun::star;

int GtkSalFrame::m_nFloats = 0;
Expand Down