Bug 65881 - fix command line option to install private colormap.

r=blizzard, sr=bryner
This commit is contained in:
tor%cs.brown.edu 2003-09-25 14:51:06 +00:00
Родитель 064a9ddd04
Коммит 302058f007
3 изменённых файлов: 15 добавлений и 15 удалений

Просмотреть файл

@ -220,15 +220,6 @@ NS_IMETHODIMP nsAppShell::Create(int *bac, char **bav)
argv = bav;
}
nsXPIDLCString cmdResult;
rv = cmdLineArgs->GetCmdLineValue("-install", getter_Copies(cmdResult));
if (NS_SUCCEEDED(rv) && cmdResult) {
gdk_rgb_set_install(TRUE);
}
gdk_rgb_init();
return NS_OK;
}

Просмотреть файл

@ -143,16 +143,11 @@ gdk_superwin_new (GdkWindow *parent_window,
attributes.width = width;
attributes.height = height;
attributes.wclass = GDK_INPUT_OUTPUT;
#if defined (__hpux) || defined (_AIX) || defined(SUNOS4) || defined(SOLARIS) || defined(__osf__)
attributes.colormap = gdk_rgb_get_cmap();
#endif
attributes.visual = gdk_rgb_get_visual();
attributes.event_mask = GDK_VISIBILITY_NOTIFY_MASK;
attributes_mask = GDK_WA_VISUAL | GDK_WA_X | GDK_WA_Y;
#if defined (__hpux) || defined (_AIX) || defined(SUNOS4) || defined(SOLARIS) || defined(__osf__)
attributes_mask = attributes_mask | GDK_WA_COLORMAP;
#endif
attributes_mask = GDK_WA_VISUAL | GDK_WA_X | GDK_WA_Y | GDK_WA_COLORMAP;
superwin->shell_window = gdk_window_new (parent_window,
&attributes, attributes_mask);

Просмотреть файл

@ -1572,11 +1572,25 @@ int main(int argc, char* argv[])
#endif
#if defined(MOZ_WIDGET_GTK) || defined(MOZ_WIDGET_GTK2)
// setup for private colormap. Ideally we'd like to do this
// in nsAppShell::Create, but we need to get in before gtk
// has been initialized to make sure everything is running
// consistently.
for (int i=1; i<argc; i++)
if ((PL_strcasecmp(argv[i], "-install") == 0)
|| (PL_strcasecmp(argv[i], "--install") == 0)) {
gdk_rgb_set_install(TRUE);
break;
}
// Initialize GTK+1/2 here for splash
#if defined(MOZ_WIDGET_GTK)
gtk_set_locale();
#endif
gtk_init(&argc, &argv);
gtk_widget_set_default_visual(gdk_rgb_get_visual());
gtk_widget_set_default_colormap(gdk_rgb_get_cmap());
#endif /* MOZ_WIDGET_GTK || MOZ_WIDGET_GTK2 */
// Call the code to install our handler