--- a/pidgin/gtkrequest.c Fri Aug 26 02:57:40 2022 -0500
+++ b/pidgin/gtkrequest.c Fri Aug 26 03:51:08 2022 -0500
@@ -2280,6 +2280,7 @@
GtkFileChooserNative *filesel;
const gchar *current_folder;
gboolean folder_set = FALSE;
@@ -2321,20 +2322,27 @@
if ((filename == NULL || *filename == '\0' || !g_file_test(filename, G_FILE_TEST_EXISTS)) &&
- (current_folder != NULL) && (*current_folder != '\0')) {
- folder_set = gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(filesel), current_folder);
+ (current_folder != NULL) && (*current_folder != '\0')) + file = g_file_new_for_path(current_folder); + folder_set = gtk_file_chooser_set_current_folder(GTK_FILE_CHOOSER(filesel), file, NULL); if (!folder_set && (filename == NULL || *filename == '\0' || !g_file_test(filename, G_FILE_TEST_EXISTS))) {
char *my_documents = wpurple_get_special_folder(CSIDL_PERSONAL);
if (my_documents != NULL) {
+ file = g_file_new_for_path(my_documents); gtk_file_chooser_set_current_folder(
- GTK_FILE_CHOOSER(filesel), my_documents);
+ GTK_FILE_CHOOSER(filesel), file, NULL); g_signal_connect(G_OBJECT(GTK_FILE_CHOOSER(filesel)), "response",
--- a/pidgin/gtkxfer.c Fri Aug 26 02:57:40 2022 -0500
+++ b/pidgin/gtkxfer.c Fri Aug 26 03:51:08 2022 -0500
@@ -551,11 +551,6 @@
GTK_TOGGLE_BUTTON(dialog->auto_clear),
purple_prefs_get_bool(PIDGIN_PREFS_ROOT
"/filetransfer/clear_finished"));
- g_signal_connect(G_OBJECT(dialog), "show",
- G_CALLBACK(winpidgin_ensure_onscreen), NULL);
--- a/pidgin/win32/gtkwin32dep.c Fri Aug 26 02:57:40 2022 -0500
+++ b/pidgin/win32/gtkwin32dep.c Fri Aug 26 03:51:08 2022 -0500
@@ -34,7 +34,6 @@
-#include <gdk/gdkwin32.h>
@@ -132,39 +131,6 @@
-void winpidgin_shell_execute(const char *target, const char *verb, const char *clazz) {
- SHELLEXECUTEINFOW wsinfo;
- wchar_t *w_uri, *w_verb, *w_clazz = NULL;
- g_return_if_fail(target != NULL);
- g_return_if_fail(verb != NULL);
- w_uri = g_utf8_to_utf16(target, -1, NULL, NULL, NULL);
- w_verb = g_utf8_to_utf16(verb, -1, NULL, NULL, NULL);
- memset(&wsinfo, 0, sizeof(wsinfo));
- wsinfo.cbSize = sizeof(wsinfo);
- wsinfo.lpVerb = w_verb;
- wsinfo.nShow = SW_SHOWNORMAL;
- wsinfo.fMask |= SEE_MASK_FLAG_NO_UI;
- w_clazz = g_utf8_to_utf16(clazz, -1, NULL, NULL, NULL);
- wsinfo.fMask |= SEE_MASK_CLASSNAME;
- wsinfo.lpClass = w_clazz;
- if(!ShellExecuteExW(&wsinfo))
- purple_debug_error("winpidgin", "Error opening URI: %s error: %d\n",
- target, (int) wsinfo.hInstApp);
#define PIDGIN_WM_FOCUS_REQUEST (WM_APP + 13)
#define PIDGIN_WM_PROTOCOL_HANDLE (WM_APP + 14)
@@ -300,9 +266,6 @@
g_free(locale_debug_dir);
- purple_debug_info("winpidgin", "GTK: %u.%u.%u\n",
- gtk_major_version, gtk_minor_version, gtk_micro_version);
messagewin_hwnd = winpidgin_message_window_init();
if (purple_debug_is_verbose())
@@ -327,135 +290,12 @@
-get_WorkingAreaRectForWindow(HWND hwnd, RECT *workingAreaRc) {
- monitor = MonitorFromWindow(hwnd, MONITOR_DEFAULTTOPRIMARY);
- info.cbSize = sizeof(info);
- if(!GetMonitorInfo(monitor, &info))
- CopyRect(workingAreaRc, &(info.rcWork));
typedef HRESULT (WINAPI* DwmIsCompositionEnabledFunction)(BOOL*);
typedef HRESULT (WINAPI* DwmGetWindowAttributeFunction)(HWND, DWORD, PVOID, DWORD);
-static HMODULE dwmapi_module = NULL;
-static DwmIsCompositionEnabledFunction DwmIsCompositionEnabled = NULL;
-static DwmGetWindowAttributeFunction DwmGetWindowAttribute = NULL;
#ifndef DWMWA_EXTENDED_FRAME_BOUNDS
# define DWMWA_EXTENDED_FRAME_BOUNDS 9
-get_actualWindowRect(HWND hwnd, RECT *winR)
- GetWindowRect(hwnd, winR);
- if (dwmapi_module == NULL) {
- dwmapi_module = GetModuleHandleW(L"dwmapi.dll");
- if (dwmapi_module != NULL) {
- DwmIsCompositionEnabled = (DwmIsCompositionEnabledFunction) GetProcAddress(dwmapi_module, "DwmIsCompositionEnabled");
- DwmGetWindowAttribute = (DwmGetWindowAttributeFunction) GetProcAddress(dwmapi_module, "DwmGetWindowAttribute");
- if (DwmIsCompositionEnabled != NULL && DwmGetWindowAttribute != NULL) {
- if (SUCCEEDED(DwmIsCompositionEnabled(&pfEnabled))) {
- if (SUCCEEDED(DwmGetWindowAttribute(hwnd, DWMWA_EXTENDED_FRAME_BOUNDS, &tempR, sizeof(tempR)))) {
-void winpidgin_ensure_onscreen(GtkWidget *win) {
- HWND hwnd = GDK_WINDOW_HWND(gtk_widget_get_window(win));
- g_return_if_fail(hwnd != NULL);
- get_actualWindowRect(hwnd, &winR);
- purple_debug_info("win32placement",
- "Window RECT: L:%ld R:%ld T:%ld B:%ld\n",
- winR.top, winR.bottom);
- if(!get_WorkingAreaRectForWindow(hwnd, &wAR)) {
- purple_debug_info("win32placement",
- "Couldn't get multimonitor working area\n");
- if(!SystemParametersInfo(SPI_GETWORKAREA, 0, &wAR, FALSE)) {
- /* I don't think this will ever happen */
- wAR.bottom = GetSystemMetrics(SM_CYSCREEN);
- wAR.right = GetSystemMetrics(SM_CXSCREEN);
- purple_debug_info("win32placement",
- "Working Area RECT: L:%ld R:%ld T:%ld B:%ld\n",
- /** If the conversation window doesn't intersect perfectly, move it to do so */
- if(!(IntersectRect(&intR, &winR, &wAR)
- && EqualRect(&intR, &winR))) {
- purple_debug_info("win32placement",
- "conversation window out of working area, relocating\n");
- /* Make sure the working area is big enough. */
- if ((winR.right - winR.left) <= (wAR.right - wAR.left)
- && (winR.bottom - winR.top) <= (wAR.bottom - wAR.top)) {
- /* Is it off the bottom? */
- if (winR.bottom > wAR.bottom) {
- winR.top = wAR.bottom - (winR.bottom - winR.top);
- winR.bottom = wAR.bottom;
- /* Is it off the top? */
- else if (winR.top < wAR.top) {
- winR.bottom = wAR.top + (winR.bottom - winR.top);
- /* Is it off the left? */
- if (winR.left < wAR.left) {
- winR.right = wAR.left + (winR.right - winR.left);
- /* Is it off the right? */
- else if (winR.right > wAR.right) {
- winR.left = wAR.right - (winR.right - winR.left);
- winR.right = wAR.right;
- /* We couldn't salvage it; move it to the top left corner of the working area */
- winR.right = wAR.left + (winR.right - winR.left);
- winR.bottom = wAR.top + (winR.bottom - winR.top);
- purple_debug_info("win32placement",
- "Relocation RECT: L:%ld R:%ld T:%ld B:%ld\n",
- winR.top, winR.bottom);
- MoveWindow(hwnd, winR.left, winR.top,
- (winR.right - winR.left),
- (winR.bottom - winR.top), TRUE);
DWORD winpidgin_get_lastactive() {
--- a/pidgin/win32/gtkwin32dep.h Fri Aug 26 02:57:40 2022 -0500
+++ b/pidgin/win32/gtkwin32dep.h Fri Aug 26 03:51:08 2022 -0500
@@ -36,8 +36,6 @@
int winpidgin_gz_untar(const char* filename, const char* destdir);
-void winpidgin_shell_execute(const char *target, const char *verb, const char *clazz);
-void winpidgin_ensure_onscreen(GtkWidget *win);
DWORD winpidgin_get_lastactive(void);