mirror of https://github.com/sipwise/jitsi.git
Loads the Java VM into Jitsi's run.exe in order to fix issue #963: Starting Jitsi via pinned taskbar icon makes a second Jitsi icon appear in the taskbar instead of highlighting the existing one. Based on ibauersachs' patch.
parent
fbd33b96f8
commit
2ce621309b
@ -1,56 +1,51 @@
|
||||
#
|
||||
# Jitsi, the OpenSource Java VoIP and Instant Messaging client.
|
||||
#
|
||||
# Distributable under LGPL license.
|
||||
# See terms of license at gnu.org.
|
||||
#
|
||||
|
||||
MINGW_HOME ?= C:/mingw
|
||||
PRODUCTNAME ?= Jitsi
|
||||
TARGET_BASENAME ?= run
|
||||
TARGET_DIR ?= ../../../../release/windows/tmp
|
||||
|
||||
ifeq ($(wildcard /bin/cygpath.*),/bin/cygpath.exe)
|
||||
target.dir := $(shell cygpath --mixed "$(TARGET_DIR)")
|
||||
cygwin.target.dir := $(shell cygpath --unix "$(TARGET_DIR)")
|
||||
else
|
||||
target.dir := "$(TARGET_DIR)"
|
||||
cygwin.target.dir := "$(TARGET_DIR)"
|
||||
endif
|
||||
|
||||
CC = $(MINGW_HOME)/bin/gcc.exe
|
||||
CPPFLAGS := $(CPPFLAGS) \
|
||||
-O2 \
|
||||
-Wall -Wreturn-type \
|
||||
-DPSAPI_VERSION=1 \
|
||||
-DWINVER=0x0502 -D_WIN32_WINNT=0x0502 \
|
||||
-I$(target.dir)
|
||||
LDFLAGS = -mwindows
|
||||
LIBS = -ladvapi32 -lpsapi
|
||||
|
||||
MACHINE = $(shell $(CC) -dumpmachine)
|
||||
WINDRES = $(MINGW_HOME)/bin/windres.exe
|
||||
ifneq ("x$(MACHINE)","x")
|
||||
ifeq ($(wildcard $(MINGW_HOME)/bin/$(MACHINE)-windres.*),$(MINGW_HOME)/bin/$(MACHINE)-windres.exe)
|
||||
WINDRES = $(MINGW_HOME)/bin/$(MACHINE)-windres.exe
|
||||
endif
|
||||
endif
|
||||
|
||||
ifdef PACKAGECODE
|
||||
DEFINE_PACKAGECODE = define PACKAGECODE "$(strip $(PACKAGECODE))"
|
||||
else
|
||||
DEFINE_PACKAGECODE = undef PACKAGECODE
|
||||
endif
|
||||
|
||||
$(cygwin.target.dir)/$(TARGET_BASENAME).exe: $(cygwin.target.dir)/config.h registry.c run.c $(cygwin.target.dir)/run.res
|
||||
$(CC) $(CPPFLAGS) registry.c run.c $(target.dir)/run.res $(LDFLAGS) -o $(target.dir)/$(TARGET_BASENAME).exe $(LIBS)
|
||||
-$(MINGW_HOME)/$(MACHINE)/bin/strip.exe $(target.dir)/$(TARGET_BASENAME).exe
|
||||
|
||||
.PHONY: $(cygwin.target.dir)/config.h
|
||||
|
||||
$(cygwin.target.dir)/config.h:
|
||||
-rm.exe -f ../../../../resources/install/windows/config.h
|
||||
echo.exe -e '#define PRODUCTNAME "$(PRODUCTNAME)"\n#$(DEFINE_PACKAGECODE)' > $(cygwin.target.dir)/config.h
|
||||
|
||||
$(cygwin.target.dir)/run.res: $(cygwin.target.dir)/config.h run.rc
|
||||
$(WINDRES) -I../../../../resources/install/windows -I$(target.dir) run.rc -O coff -o $(target.dir)/run.res
|
||||
#
|
||||
# Jitsi, the OpenSource Java VoIP and Instant Messaging client.
|
||||
#
|
||||
# Distributable under LGPL license.
|
||||
# See terms of license at gnu.org.
|
||||
#
|
||||
|
||||
MINGW_HOME ?= C:/mingw
|
||||
PRODUCTNAME ?= Jitsi
|
||||
TARGET_BASENAME ?= run
|
||||
TARGET_DIR ?= ../../../../release/windows/tmp
|
||||
|
||||
ifeq ($(wildcard /bin/cygpath.*),/bin/cygpath.exe)
|
||||
target.dir := $(shell cygpath --mixed "$(TARGET_DIR)")
|
||||
cygwin.target.dir := $(shell cygpath --unix "$(TARGET_DIR)")
|
||||
else
|
||||
target.dir := "$(TARGET_DIR)"
|
||||
cygwin.target.dir := "$(TARGET_DIR)"
|
||||
endif
|
||||
|
||||
CC = $(MINGW_HOME)/bin/gcc.exe
|
||||
CPPFLAGS := $(CPPFLAGS) \
|
||||
-O2 \
|
||||
-Wall -Wreturn-type \
|
||||
-DPSAPI_VERSION=1 \
|
||||
-DWINVER=0x0502 -D_WIN32_WINNT=0x0502 \
|
||||
-I$(target.dir) \
|
||||
-I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/win32
|
||||
LDFLAGS = -mwindows
|
||||
LIBS = -ladvapi32 -lpsapi
|
||||
|
||||
MACHINE = $(shell $(CC) -dumpmachine)
|
||||
WINDRES = $(MINGW_HOME)/bin/windres.exe
|
||||
ifneq ("x$(MACHINE)","x")
|
||||
ifeq ($(wildcard $(MINGW_HOME)/bin/$(MACHINE)-windres.*),$(MINGW_HOME)/bin/$(MACHINE)-windres.exe)
|
||||
WINDRES = $(MINGW_HOME)/bin/$(MACHINE)-windres.exe
|
||||
endif
|
||||
endif
|
||||
|
||||
$(cygwin.target.dir)/$(TARGET_BASENAME).exe: $(cygwin.target.dir)/config.h registry.c run.c $(cygwin.target.dir)/run.res ../setup/nls.c
|
||||
$(CC) $(CPPFLAGS) registry.c run.c $(target.dir)/run.res ../setup/nls.c $(LDFLAGS) -o $(target.dir)/$(TARGET_BASENAME).exe $(LIBS)
|
||||
-$(MINGW_HOME)/$(MACHINE)/bin/strip.exe $(target.dir)/$(TARGET_BASENAME).exe
|
||||
|
||||
.PHONY: $(cygwin.target.dir)/config.h
|
||||
|
||||
$(cygwin.target.dir)/config.h:
|
||||
-rm.exe -f ../../../../resources/install/windows/config.h
|
||||
echo.exe -e '#define PRODUCTNAME "$(PRODUCTNAME)"' > $(cygwin.target.dir)/config.h
|
||||
|
||||
$(cygwin.target.dir)/run.res: $(cygwin.target.dir)/config.h run.rc
|
||||
$(WINDRES) -I../../../../resources/install/windows -I$(target.dir) run.rc -O coff -o $(target.dir)/run.res
|
||||
|
||||
@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
|
||||
#include "nls.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
LPWSTR
|
||||
NLS_str2wstr(LPCSTR str)
|
||||
{
|
||||
int wstrSize = MultiByteToWideChar(CP_THREAD_ACP, 0, str, -1, NULL, 0);
|
||||
LPWSTR wstr;
|
||||
|
||||
if (wstrSize)
|
||||
{
|
||||
wstr = malloc(wstrSize * sizeof(WCHAR));
|
||||
if (wstr)
|
||||
{
|
||||
wstrSize
|
||||
= MultiByteToWideChar(
|
||||
CP_THREAD_ACP,
|
||||
0,
|
||||
str, -1,
|
||||
wstr, wstrSize);
|
||||
if (!wstrSize)
|
||||
{
|
||||
free(wstr);
|
||||
wstr = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
wstr = NULL;
|
||||
return wstr;
|
||||
}
|
||||
|
||||
LPSTR
|
||||
NLS_wstr2str(LPCWSTR wstr)
|
||||
{
|
||||
int strSize
|
||||
= WideCharToMultiByte(
|
||||
CP_THREAD_ACP,
|
||||
WC_NO_BEST_FIT_CHARS,
|
||||
wstr, -1,
|
||||
NULL, 0,
|
||||
NULL, NULL);
|
||||
LPSTR str;
|
||||
|
||||
if (strSize)
|
||||
{
|
||||
str = malloc(strSize);
|
||||
if (str)
|
||||
{
|
||||
strSize
|
||||
= WideCharToMultiByte(
|
||||
CP_THREAD_ACP,
|
||||
WC_NO_BEST_FIT_CHARS,
|
||||
wstr, -1,
|
||||
str, strSize,
|
||||
NULL, NULL);
|
||||
if (!strSize)
|
||||
{
|
||||
free(str);
|
||||
str = NULL;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
str = NULL;
|
||||
return str;
|
||||
}
|
||||
@ -0,0 +1,16 @@
|
||||
/*
|
||||
* Jitsi, the OpenSource Java VoIP and Instant Messaging client.
|
||||
*
|
||||
* Distributable under LGPL license.
|
||||
* See terms of license at gnu.org.
|
||||
*/
|
||||
|
||||
#ifndef _ORG_JITSI_WINDOWS_SETUP_NLS_H_
|
||||
#define _ORG_JITSI_WINDOWS_SETUP_NLS_H_
|
||||
|
||||
#include <windows.h>
|
||||
|
||||
LPWSTR NLS_str2wstr(LPCSTR str);
|
||||
LPSTR NLS_wstr2str(LPCWSTR wstr);
|
||||
|
||||
#endif /* #ifndef _ORG_JITSI_WINDOWS_SETUP_NLS_H_ */
|
||||
Loading…
Reference in new issue