Fri, 01 May 2020 05:15:51 -0500
Update all of the pidgin code to include purple.h
| 14286 | 1 | /* |
| 15884 | 2 | * purple - WinPurple Options Plugin |
| 14286 | 3 | * |
| 4 | * File: gtkappbar.c | |
| 5 | * Date: August 2, 2003 | |
| 6 | * Description: Appbar functionality for Windows GTK+ applications | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
7 | * |
| 14286 | 8 | * Copyright (C) 2003, Herman Bloggs <hermanator12002@yahoo.com> |
| 9 | * | |
| 10 | * This program is free software; you can redistribute it and/or modify | |
| 11 | * it under the terms of the GNU General Public License as published by | |
| 12 | * the Free Software Foundation; either version 2 of the License, or | |
| 13 | * (at your option) any later version. | |
| 14 | * | |
| 15 | * This program is distributed in the hope that it will be useful, | |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 18 | * GNU General Public License for more details. | |
| 19 | * | |
| 20 | * You should have received a copy of the GNU General Public License | |
| 21 | * along with this program; if not, write to the Free Software | |
|
19859
71d37b57eff2
The FSF changed its address a while ago; our files were out of date.
John Bailey <rekkanoryo@rekkanoryo.org>
parents:
19395
diff
changeset
|
22 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA |
| 14286 | 23 | * |
| 24 | */ | |
| 25 | /* | |
| 26 | * TODO: | |
| 27 | * - Move 'App on top' feature from Trans plugin to here | |
| 28 | * - Bug: Multiple Show/Hide Desktop calls causes client area to disappear | |
| 29 | */ | |
| 30 | #include <windows.h> | |
| 31 | #include <winver.h> | |
| 32 | #include <stdio.h> | |
| 33 | #include <gtk/gtk.h> | |
| 34 | #include <gdk/gdkwin32.h> | |
| 35 | #include "gtkappbar.h" | |
| 36 | ||
| 37 | #define APPBAR_CALLBACK WM_USER + 1010 | |
| 38 | ||
| 15884 | 39 | typedef HMONITOR WINAPI purple_MonitorFromPoint(POINT, DWORD); |
| 40 | typedef HMONITOR WINAPI purple_MonitorFromWindow(HWND, DWORD); | |
| 41 | typedef BOOL WINAPI purple_GetMonitorInfo(HMONITOR, LPMONITORINFO); | |
| 14286 | 42 | |
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
43 | static void gtk_appbar_do_dock(GtkAppBar *ab, UINT side); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
44 | |
|
35896
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
45 | static inline HWND |
|
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
46 | appbar_get_handle(GtkAppBar *ab) |
|
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
47 | { |
|
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
48 | return GDK_WINDOW_HWND(gtk_widget_get_window(ab->win)); |
|
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
49 | } |
|
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
50 | |
| 14286 | 51 | /* Retrieve the rectangular display area from the specified monitor |
| 52 | * Return TRUE if successful, otherwise FALSE | |
| 53 | */ | |
| 54 | static gboolean | |
| 55 | get_rect_from_monitor(HMODULE hmod, HMONITOR monitor, RECT *rect) { | |
| 15884 | 56 | purple_GetMonitorInfo *the_GetMonitorInfo; |
| 14286 | 57 | MONITORINFO info; |
| 58 | ||
| 15884 | 59 | if (!(the_GetMonitorInfo = (purple_GetMonitorInfo*) |
| 14286 | 60 | GetProcAddress(hmod, "GetMonitorInfoA"))) { |
| 61 | return FALSE; | |
| 62 | } | |
| 63 | ||
| 64 | info.cbSize = sizeof(info); | |
| 65 | if (!the_GetMonitorInfo(monitor, &info)) { | |
| 66 | return FALSE; | |
| 67 | } | |
| 68 | ||
| 69 | CopyRect(rect, &(info.rcMonitor)); | |
| 70 | ||
| 71 | return TRUE; | |
| 72 | } | |
| 73 | ||
| 74 | /** | |
| 75 | * This will only work on Win98+ and Win2K+ | |
| 76 | * Return TRUE if successful, otherwise FALSE | |
| 77 | */ | |
| 78 | static gboolean | |
| 79 | get_rect_at_point_multimonitor(POINT pt, RECT *rect) { | |
| 80 | HMODULE hmod; | |
| 15884 | 81 | purple_MonitorFromPoint *the_MonitorFromPoint; |
| 14286 | 82 | HMONITOR monitor; |
| 83 | ||
| 84 | if (!(hmod = GetModuleHandle("user32"))) { | |
| 85 | return FALSE; | |
| 86 | } | |
| 87 | ||
| 15884 | 88 | if (!(the_MonitorFromPoint = (purple_MonitorFromPoint*) |
| 14286 | 89 | GetProcAddress(hmod, "MonitorFromPoint"))) { |
| 90 | return FALSE; | |
| 91 | } | |
| 92 | ||
| 93 | monitor = | |
| 94 | the_MonitorFromPoint(pt, MONITOR_DEFAULTTOPRIMARY); | |
| 95 | ||
| 96 | return get_rect_from_monitor(hmod, monitor, rect); | |
| 97 | } | |
| 98 | ||
| 99 | /** | |
| 100 | * This will only work on Win98+ and Win2K+ | |
| 101 | * Return TRUE if successful, otherwise FALSE | |
| 102 | */ | |
| 103 | static gboolean | |
| 104 | get_rect_of_window_multimonitor(HWND window, RECT *rect) { | |
| 105 | HMODULE hmod; | |
| 15884 | 106 | purple_MonitorFromWindow *the_MonitorFromWindow; |
| 14286 | 107 | HMONITOR monitor; |
| 108 | ||
| 109 | if (!(hmod = GetModuleHandle("user32"))) { | |
| 110 | return FALSE; | |
| 111 | } | |
| 112 | ||
| 15884 | 113 | if (!(the_MonitorFromWindow = (purple_MonitorFromWindow*) |
| 14286 | 114 | GetProcAddress(hmod, "MonitorFromWindow"))) { |
| 115 | return FALSE; | |
| 116 | } | |
| 117 | ||
| 118 | monitor = | |
| 119 | the_MonitorFromWindow(window, MONITOR_DEFAULTTOPRIMARY); | |
| 120 | ||
| 121 | return get_rect_from_monitor(hmod, monitor, rect); | |
| 122 | } | |
| 123 | ||
| 124 | /* | |
| 125 | * Fallback if cannot get the RECT from the monitor directly | |
| 126 | */ | |
| 127 | static void get_default_workarea(RECT *rect) { | |
| 128 | if (!SystemParametersInfo(SPI_GETWORKAREA, 0, &rect, FALSE)) { | |
| 129 | /* I don't think this will ever happen */ | |
| 130 | rect->left = 0; | |
| 131 | rect->top = 0; | |
| 132 | rect->bottom = GetSystemMetrics(SM_CYSCREEN); | |
| 133 | rect->right = GetSystemMetrics(SM_CXSCREEN); | |
| 134 | } | |
| 135 | } | |
| 136 | ||
| 137 | /* Retrieve the rectangle of the active work area at a point */ | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
138 | static void get_rect_at_point(POINT pt, RECT *rc) { |
|
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
139 | if (!get_rect_at_point_multimonitor(pt, rc)) { |
|
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
140 | get_default_workarea(rc); |
| 14286 | 141 | } |
| 142 | } | |
| 143 | ||
| 144 | /* Retrieve the rectangle of the active work area of a window*/ | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
145 | static void get_rect_of_window(HWND window, RECT *rc) { |
|
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
146 | if (!get_rect_of_window_multimonitor(window, rc)) { |
|
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
147 | get_default_workarea(rc); |
| 14286 | 148 | } |
| 149 | } | |
| 150 | ||
| 151 | static void get_window_normal_rc(HWND hwnd, RECT *rc) { | |
| 152 | WINDOWPLACEMENT wplc; | |
| 153 | GetWindowPlacement(hwnd, &wplc); | |
| 154 | CopyRect(rc, &wplc.rcNormalPosition); | |
| 155 | } | |
| 156 | #if 0 | |
| 157 | static void print_rect(RECT *rc) { | |
| 15884 | 158 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "RECT: L:%ld R:%ld T:%ld B:%ld\n", |
| 14286 | 159 | rc->left, rc->right, rc->top, rc->bottom); |
| 160 | } | |
| 161 | #endif | |
| 162 | /** Set the window style to be the "Tool Window" style - small header, no min/max buttons */ | |
| 163 | static void set_toolbar(HWND hwnd, gboolean val) { | |
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
164 | LONG style = GetWindowLong(hwnd, GWL_EXSTYLE); |
| 14286 | 165 | |
| 166 | if(val && !(style & WS_EX_TOOLWINDOW)) | |
| 167 | style |= WS_EX_TOOLWINDOW; | |
| 168 | else if(!val && style & WS_EX_TOOLWINDOW) | |
| 169 | style &= ~WS_EX_TOOLWINDOW; | |
| 170 | else | |
| 171 | return; | |
| 172 | SetWindowLong(hwnd, GWL_EXSTYLE, style); | |
| 173 | SetWindowPos(hwnd, 0, 0, 0, 0, 0, | |
| 174 | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
25910
diff
changeset
|
175 | |
| 14286 | 176 | /* This really should be the following, but SWP_FRAMECHANGED strangely causes initermittent problems "Show Desktop" done more than once. |
| 177 | * Not having SWP_FRAMECHANGED *should* cause the Style not to be applied, but i haven't noticed any problems | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
178 | * SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); |
| 14286 | 179 | */ |
| 180 | } | |
| 181 | /** Register the window as an appbar */ | |
| 182 | static gboolean gtk_appbar_register(GtkAppBar *ab, HWND hwnd) { | |
| 183 | APPBARDATA abd; | |
| 184 | ||
| 185 | abd.cbSize = sizeof(APPBARDATA); | |
| 186 | abd.hWnd = hwnd; | |
| 187 | abd.uCallbackMessage = APPBAR_CALLBACK; | |
| 188 | ||
| 189 | ab->registered = SHAppBarMessage(ABM_NEW, &abd); | |
| 190 | ||
| 191 | return ab->registered; | |
| 192 | } | |
| 193 | /** Unregister the window as an appbar */ | |
| 194 | static gboolean gtk_appbar_unregister(GtkAppBar *ab, HWND hwnd) { | |
| 195 | APPBARDATA abd; | |
| 196 | ||
| 197 | if(!ab->registered) | |
| 198 | return TRUE; | |
| 199 | ||
| 200 | abd.cbSize = sizeof(APPBARDATA); | |
| 201 | abd.hWnd = hwnd; | |
| 202 | ||
| 203 | SHAppBarMessage(ABM_REMOVE, &abd); /** This always returns TRUE */ | |
| 204 | ||
| 205 | ab->registered = FALSE; | |
| 206 | ||
| 207 | ab->docked = FALSE; | |
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
208 | ab->undocking = FALSE; |
| 14286 | 209 | ab->docking = FALSE; |
| 210 | ||
| 211 | return TRUE; | |
| 212 | } | |
| 213 | ||
| 214 | static void gtk_appbar_querypos(GtkAppBar *ab, HWND hwnd, RECT rcWorkspace) { | |
| 215 | APPBARDATA abd; | |
| 216 | guint iWidth = 0; | |
| 217 | ||
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
218 | if(!ab->registered) |
|
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
219 | gtk_appbar_register(ab, hwnd); |
| 14286 | 220 | |
| 221 | abd.hWnd = hwnd; | |
| 222 | abd.cbSize = sizeof(APPBARDATA); | |
| 223 | abd.uEdge = ab->side; | |
| 224 | ||
| 225 | iWidth = ab->docked_rect.right - ab->docked_rect.left; | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
226 | |
| 14286 | 227 | abd.rc.top = rcWorkspace.top; |
| 228 | abd.rc.bottom = rcWorkspace.bottom; | |
| 229 | switch (abd.uEdge) | |
| 230 | { | |
| 231 | case ABE_LEFT: | |
| 232 | abd.rc.left = rcWorkspace.left; | |
| 233 | abd.rc.right = rcWorkspace.left + iWidth; | |
| 234 | break; | |
| 235 | ||
| 236 | case ABE_RIGHT: | |
| 237 | abd.rc.right = rcWorkspace.right; | |
| 238 | abd.rc.left = rcWorkspace.right - iWidth; | |
| 239 | break; | |
| 240 | } | |
| 241 | ||
| 242 | /* Ask the system for the screen space */ | |
| 243 | SHAppBarMessage(ABM_QUERYPOS, &abd); | |
| 244 | ||
| 245 | switch (abd.uEdge) | |
| 246 | { | |
| 247 | case ABE_LEFT: | |
| 248 | abd.rc.right = abd.rc.left + iWidth; | |
| 249 | break; | |
| 250 | ||
| 251 | case ABE_RIGHT: | |
| 252 | abd.rc.left = abd.rc.right - iWidth; | |
| 253 | break; | |
| 254 | } | |
| 255 | ||
| 256 | CopyRect(&(ab->docked_rect), &abd.rc); | |
| 257 | } | |
| 258 | /* Actually set the size and screen location of the appbar */ | |
| 259 | static void gtk_appbar_setpos(GtkAppBar *ab, HWND hwnd) { | |
| 260 | APPBARDATA abd; | |
| 261 | ||
| 262 | if(!ab->registered) | |
| 263 | gtk_appbar_register(ab, hwnd); | |
| 264 | ||
| 265 | abd.hWnd = hwnd; | |
| 266 | abd.cbSize = sizeof(APPBARDATA); | |
| 267 | CopyRect(&abd.rc, &(ab->docked_rect)); | |
| 268 | abd.uEdge = ab->side; | |
| 269 | ||
| 270 | SHAppBarMessage(ABM_SETPOS, &abd); | |
| 271 | } | |
| 272 | /** Let any callbacks know that we have docked or undocked */ | |
| 273 | static void gtk_appbar_dispatch_dock_cbs(GtkAppBar *ab, gboolean val) { | |
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
274 | GSList *lst = ab->dock_cbs; |
| 14286 | 275 | |
| 276 | while(lst) { | |
| 277 | GtkAppBarDockCB dock_cb = lst->data; | |
| 278 | dock_cb(val); | |
| 279 | lst = lst->next; | |
| 280 | } | |
| 281 | } | |
| 282 | ||
| 283 | static GdkFilterReturn wnd_moving(GtkAppBar *ab, GdkXEvent *xevent) { | |
| 284 | MSG *msg = (MSG*)xevent; | |
| 285 | POINT cp; | |
| 286 | RECT *rc = (RECT*)msg->lParam; | |
| 287 | RECT monRect; | |
| 288 | int side = -1; | |
| 289 | long dockAreaWidth = 0; | |
| 290 | ||
| 15884 | 291 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "wnd_moving\n"); |
| 14286 | 292 | |
| 293 | GetCursorPos(&cp); | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
294 | get_rect_at_point(cp, &monRect); |
| 14286 | 295 | |
| 296 | dockAreaWidth = (monRect.right - monRect.left) / 10; | |
| 297 | /* Which part of the screen are we in ? */ | |
| 298 | if (cp.x > (monRect.right - dockAreaWidth)) { | |
| 299 | side = ABE_RIGHT; | |
| 300 | } else if (cp.x < (monRect.left + dockAreaWidth)) { | |
| 301 | side = ABE_LEFT; | |
| 302 | } | |
| 303 | ||
| 304 | if(!ab->docked) { | |
| 305 | if( (side == ABE_RIGHT || side == ABE_LEFT) ) { | |
| 306 | if( !ab->docking ) { | |
| 307 | ab->side = side; | |
| 308 | GetWindowRect(msg->hwnd, &(ab->docked_rect)); | |
| 309 | gtk_appbar_querypos(ab, msg->hwnd, monRect); | |
| 310 | ||
| 311 | /* save pre-docking height */ | |
| 312 | ab->undocked_height = rc->bottom - rc->top; | |
| 313 | ab->docking = TRUE; | |
| 314 | } | |
| 315 | } | |
| 316 | else | |
| 317 | ab->docking = FALSE; | |
| 318 | } | |
| 319 | else if(side < 0) { | |
| 320 | gtk_appbar_unregister(ab, msg->hwnd); | |
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
321 | ab->undocking = TRUE; |
| 14286 | 322 | rc->bottom = rc->top + ab->undocked_height; |
| 323 | } | |
| 324 | ||
| 325 | return GDK_FILTER_CONTINUE; | |
| 326 | } | |
| 327 | ||
| 328 | static GdkFilterReturn wnd_sizing(GtkAppBar *ab, GdkXEvent *xevent) { | |
| 329 | MSG *msg = (MSG*)xevent; | |
| 330 | ||
| 15884 | 331 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "wnd_sizing\n"); |
| 14286 | 332 | if(ab->docked) { |
| 333 | RECT *rc = (RECT*)msg->lParam; | |
| 334 | if(ab->side == ABE_LEFT && msg->wParam == WMSZ_RIGHT) { | |
| 335 | ab->docked_rect.right = rc->right; | |
| 336 | gtk_appbar_setpos(ab, msg->hwnd); | |
| 337 | } | |
| 338 | else if(ab->side == ABE_RIGHT && msg->wParam == WMSZ_LEFT) { | |
| 339 | ab->docked_rect.left = rc->left; | |
| 340 | gtk_appbar_setpos(ab, msg->hwnd); | |
| 341 | } | |
| 342 | return GDK_FILTER_REMOVE; | |
| 343 | } | |
| 344 | return GDK_FILTER_CONTINUE; | |
| 345 | } | |
| 346 | /** Notify the system that the appbar has been activated */ | |
| 347 | static GdkFilterReturn wnd_activate(GtkAppBar *ab, GdkXEvent *xevent) { | |
| 348 | if (ab->registered) { | |
| 349 | APPBARDATA abd; | |
| 350 | MSG *msg = (MSG*)xevent; | |
| 15884 | 351 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "wnd_activate\n"); |
| 14286 | 352 | |
| 353 | abd.hWnd = msg->hwnd; | |
| 354 | abd.cbSize = sizeof(APPBARDATA); | |
| 355 | ||
| 356 | SHAppBarMessage(ABM_ACTIVATE, &abd); | |
| 357 | } | |
| 358 | return GDK_FILTER_CONTINUE; | |
| 359 | } | |
|
20846
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
360 | |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
361 | static void show_hide(GtkAppBar *ab, gboolean hide) { |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
362 | purple_debug_info("gtkappbar", "show_hide(%d)\n", hide); |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
363 | |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
364 | if (hide) { |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
365 | purple_debug_info("gtkappbar", "hidden\n"); |
|
35896
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
366 | gtk_appbar_unregister(ab, appbar_get_handle(ab)); |
|
20846
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
367 | ab->docked = TRUE; |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
368 | ab->iconized = TRUE; |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
369 | } else { |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
370 | ab->iconized = FALSE; |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
371 | purple_debug_info("gtkappbar", "shown\n"); |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
372 | ab->docked = FALSE; |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
373 | gtk_appbar_do_dock(ab, ab->side); |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
374 | } |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
375 | |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
376 | } |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
377 | |
| 14286 | 378 | /** Notify the system that the appbar's position has changed */ |
| 379 | static GdkFilterReturn wnd_poschanged(GtkAppBar *ab, GdkXEvent *xevent) { | |
| 380 | if (ab->registered) { | |
| 381 | APPBARDATA abd; | |
| 382 | MSG *msg = (MSG*)xevent; | |
|
20846
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
383 | |
|
25910
d24c4a9d28f2
Changing debug levels. These messages fire every single time a window changes focus, making debugging anything else impossible
Casey Ho <caseyho@pidgin.im>
parents:
20846
diff
changeset
|
384 | purple_debug(PURPLE_DEBUG_MISC, "gtkappbar", "wnd_poschanged\n"); |
| 14286 | 385 | |
| 386 | abd.hWnd = msg->hwnd; | |
| 387 | abd.cbSize = sizeof(APPBARDATA); | |
| 388 | ||
| 389 | SHAppBarMessage(ABM_WINDOWPOSCHANGED, &abd); | |
|
20846
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
390 | |
| 14286 | 391 | } |
| 392 | return GDK_FILTER_CONTINUE; | |
| 393 | } | |
| 394 | /** The window is about to change */ | |
| 395 | static GdkFilterReturn wnd_poschanging(GtkAppBar *ab, GdkXEvent *xevent) { | |
| 396 | MSG *msg = (MSG*)xevent; | |
| 397 | WINDOWPOS *wpos = (WINDOWPOS*)msg->lParam; | |
| 398 | ||
|
25910
d24c4a9d28f2
Changing debug levels. These messages fire every single time a window changes focus, making debugging anything else impossible
Casey Ho <caseyho@pidgin.im>
parents:
20846
diff
changeset
|
399 | purple_debug(PURPLE_DEBUG_MISC, "gtkappbar", "wnd_poschanging\n"); |
| 14286 | 400 | |
| 401 | if(ab->docked || ab->docking) { | |
| 402 | wpos->x = ab->docked_rect.left; | |
| 403 | wpos->y = ab->docked_rect.top; | |
| 404 | wpos->cx = ab->docked_rect.right - ab->docked_rect.left; | |
| 405 | wpos->cy = ab->docked_rect.bottom - ab->docked_rect.top; | |
| 406 | if(IsIconic(msg->hwnd)) | |
| 407 | set_toolbar(msg->hwnd, FALSE); | |
| 408 | /*return GDK_FILTER_REMOVE;*/ | |
| 409 | } | |
|
20846
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
410 | |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
411 | if (ab->docked) { |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
412 | if (ab->iconized && wpos->flags & SWP_SHOWWINDOW) |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
413 | show_hide(ab, FALSE); |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
414 | else if (!ab->iconized && wpos->flags & SWP_HIDEWINDOW) |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
415 | show_hide(ab, TRUE); |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
416 | } |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
417 | |
| 14286 | 418 | return GDK_FILTER_CONTINUE; |
| 419 | } | |
| 420 | ||
| 421 | static GdkFilterReturn wnd_exitsizemove(GtkAppBar *ab, GdkXEvent *xevent) { | |
| 422 | MSG *msg = (MSG*)xevent; | |
| 423 | ||
| 15884 | 424 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "wnd_exitsizemove\n"); |
| 14286 | 425 | if(ab->docking) { |
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
426 | gtk_appbar_setpos(ab, msg->hwnd); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
427 | ab->docking = FALSE; |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
428 | ab->docked = TRUE; |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
429 | ShowWindow(msg->hwnd, SW_HIDE); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
430 | set_toolbar(msg->hwnd, TRUE); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
431 | ShowWindow(msg->hwnd, SW_SHOW); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
432 | gtk_appbar_dispatch_dock_cbs(ab, TRUE); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
433 | } else if(ab->undocking) { |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
434 | ShowWindow(msg->hwnd, SW_HIDE); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
435 | set_toolbar(msg->hwnd, FALSE); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
436 | ShowWindow(msg->hwnd, SW_SHOW); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
437 | gtk_appbar_dispatch_dock_cbs(ab, FALSE); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
438 | ab->undocking = FALSE; |
| 14286 | 439 | } |
| 440 | ||
| 441 | return GDK_FILTER_CONTINUE; | |
| 442 | } | |
| 443 | ||
| 444 | static GdkFilterReturn wnd_showwindow(GtkAppBar *ab, GdkXEvent *xevent) { | |
|
20846
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
445 | MSG *msg = (MSG*)xevent; |
| 14286 | 446 | |
|
20846
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
447 | purple_debug_info("gtkappbar", "wnd_showwindow\n"); |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
448 | if(msg->wParam && ab->docked) { |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
449 | show_hide(ab, FALSE); |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
450 | } else if(!msg->wParam && ab->docked) { |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
451 | show_hide(ab, TRUE); |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
452 | } |
|
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
453 | return GDK_FILTER_CONTINUE; |
| 14286 | 454 | } |
|
20846
370ee55e1acb
Undock/Redock the buddy list based on the SWP_SHOWWINDOW and SWP_HIDEWINDOW attributes in a WM_WINDOWPOSCHANGING message. This doesn't appear to have any negative effects and makes Pidgin play nicer with the VirtuaWin virtual desktop manager. Fixes #2997.
Daniel Atallah <datallah@pidgin.im>
parents:
19859
diff
changeset
|
455 | |
| 14286 | 456 | /** The window's size has changed */ |
| 457 | static GdkFilterReturn wnd_size(GtkAppBar *ab, GdkXEvent *xevent) { | |
| 458 | MSG *msg = (MSG*)xevent; | |
| 459 | ||
| 15884 | 460 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "wnd_size\n"); |
| 14286 | 461 | |
| 462 | if(msg->wParam == SIZE_MINIMIZED) { | |
| 15884 | 463 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "Minimize\n"); |
| 14286 | 464 | if(ab->docked) { |
|
35896
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
465 | gtk_appbar_unregister(ab, appbar_get_handle(ab)); |
| 14286 | 466 | ab->docked = TRUE; |
| 467 | } | |
| 468 | } | |
| 469 | else if(msg->wParam == SIZE_RESTORED) { | |
| 15884 | 470 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "Restore\n"); |
| 14286 | 471 | if (!ab->iconized && ab->docked) { |
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
472 | gtk_appbar_do_dock(ab, ab->side); |
| 14286 | 473 | } |
| 474 | } | |
| 475 | return GDK_FILTER_CONTINUE; | |
| 476 | } | |
| 477 | ||
| 478 | static GdkFilterReturn wnd_nchittest(GtkAppBar *ab, GdkXEvent *xevent) { | |
| 479 | MSG *msg = (MSG*)xevent; | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
480 | |
| 14286 | 481 | if(ab->docked) { |
| 482 | UINT ret = DefWindowProc(msg->hwnd, msg->message, msg->wParam, msg->lParam); | |
| 483 | ||
| 484 | switch(ret) { | |
| 485 | case HTBOTTOM: | |
| 486 | case HTBOTTOMLEFT: | |
| 487 | case HTBOTTOMRIGHT: | |
| 488 | case HTTOP: | |
| 489 | case HTTOPLEFT: | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
490 | case HTTOPRIGHT: |
| 14286 | 491 | return GDK_FILTER_REMOVE; |
| 492 | case HTLEFT: | |
| 493 | if(ab->side == ABE_LEFT) | |
| 494 | return GDK_FILTER_REMOVE; | |
| 495 | break; | |
| 496 | case HTRIGHT: | |
| 497 | if(ab->side == ABE_RIGHT) | |
| 498 | return GDK_FILTER_REMOVE; | |
| 499 | break; | |
| 500 | } | |
| 501 | } | |
| 502 | return GDK_FILTER_CONTINUE; | |
| 503 | } | |
| 504 | ||
| 505 | #if 0 | |
| 506 | static GdkFilterReturn wnd_initmenupopup(GtkAppBar *ab, GdkXEvent *xevent) { | |
| 507 | MSG *msg = (MSG*)xevent; | |
| 508 | ||
| 509 | if(ab->docked && HIWORD(msg->lParam)) { | |
| 510 | HMENU sysmenu = GetSystemMenu(msg->hwnd, FALSE); | |
| 15884 | 511 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "wnd_initpopupmenu: docked: %d ismenu: %d\n", ab->docked, IsMenu(sysmenu)); |
| 14286 | 512 | if(EnableMenuItem(sysmenu, SC_MAXIMIZE, MF_BYCOMMAND|MF_GRAYED)<0) |
| 15884 | 513 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "SC_MAXIMIZE Menu item does not exist\n"); |
| 14286 | 514 | if(EnableMenuItem(sysmenu, SC_MOVE, MF_BYCOMMAND|MF_GRAYED)<0) |
| 15884 | 515 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "SC_MOVE Menu item does not exist\n"); |
| 14286 | 516 | return GDK_FILTER_CONTINUE; |
| 517 | } | |
| 518 | else | |
| 519 | GetSystemMenu(msg->hwnd, TRUE); | |
| 520 | return GDK_FILTER_CONTINUE; | |
| 521 | } | |
| 522 | #endif | |
| 523 | ||
| 524 | static GdkFilterReturn gtk_appbar_callback(GtkAppBar *ab, GdkXEvent *xevent) { | |
| 525 | MSG *msg = (MSG*)xevent; | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
526 | RECT orig, windowRect; |
| 14286 | 527 | |
| 528 | switch (msg->wParam) { | |
| 529 | case ABN_STATECHANGE: | |
| 15884 | 530 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "gtk_appbar_callback: ABN_STATECHANGE\n"); |
| 14286 | 531 | break; |
| 532 | ||
| 533 | case ABN_FULLSCREENAPP: | |
|
25910
d24c4a9d28f2
Changing debug levels. These messages fire every single time a window changes focus, making debugging anything else impossible
Casey Ho <caseyho@pidgin.im>
parents:
20846
diff
changeset
|
534 | purple_debug(PURPLE_DEBUG_MISC, "gtkappbar", "gtk_appbar_callback: ABN_FULLSCREENAPP: %d\n", (BOOL)msg->lParam); |
| 14286 | 535 | if (!ab->iconized && ab->docked) { |
| 536 | if ((BOOL)msg->lParam) { | |
| 537 | SetWindowPos(msg->hwnd, HWND_BOTTOM, 0, 0, 0, 0, | |
| 538 | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); | |
| 539 | } else { | |
| 540 | SetWindowPos(msg->hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, | |
| 541 | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_FRAMECHANGED); | |
| 542 | } | |
| 543 | } | |
| 544 | ||
| 545 | break; | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
546 | case ABN_POSCHANGED: |
| 15884 | 547 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "gtk_appbar_callback: ABN_POSCHANGED\n"); |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
548 | CopyRect(&orig, &(ab->docked_rect)); |
|
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
549 | get_rect_of_window(msg->hwnd, &windowRect); |
|
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
550 | gtk_appbar_querypos(ab, msg->hwnd, windowRect); |
| 14286 | 551 | if (EqualRect(&orig, &(ab->docked_rect)) == 0) { |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
552 | MoveWindow(msg->hwnd, ab->docked_rect.left, ab->docked_rect.top, |
| 14286 | 553 | ab->docked_rect.right - ab->docked_rect.left, |
| 554 | ab->docked_rect.bottom - ab->docked_rect.top, TRUE); | |
| 555 | } | |
| 556 | gtk_appbar_setpos(ab, msg->hwnd); | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
557 | break; |
| 14286 | 558 | #if 0 |
| 559 | default: | |
| 15884 | 560 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "gtk_appbar_callback: %d\n", msg->wParam); |
| 14286 | 561 | #endif |
| 562 | } | |
| 563 | return GDK_FILTER_CONTINUE; | |
| 564 | } | |
| 565 | ||
| 566 | static GdkFilterReturn gtk_appbar_event_filter(GdkXEvent *xevent, GdkEvent *event, gpointer data) { | |
| 567 | MSG *msg = (MSG*)xevent; | |
| 568 | ||
| 569 | /*printf("MSG: %s\n", message_to_string (msg->message));*/ | |
| 570 | switch(msg->message) { | |
| 571 | case WM_EXITSIZEMOVE: | |
| 572 | return wnd_exitsizemove(data, xevent); | |
| 573 | case WM_WINDOWPOSCHANGING: | |
| 574 | return wnd_poschanging(data, xevent); | |
| 575 | case WM_WINDOWPOSCHANGED: | |
| 576 | return wnd_poschanged(data, xevent); | |
| 577 | case WM_ACTIVATE: | |
| 578 | return wnd_activate(data, xevent); | |
| 579 | case WM_SIZING: | |
| 580 | return wnd_sizing(data, xevent); | |
| 581 | case WM_MOVING: | |
| 582 | return wnd_moving(data, xevent); | |
| 583 | case WM_SHOWWINDOW: | |
| 584 | return wnd_showwindow(data, xevent); | |
| 585 | case WM_NCHITTEST: | |
| 586 | return wnd_nchittest(data, xevent); | |
| 587 | #if 0 | |
| 588 | case WM_INITMENUPOPUP: | |
| 589 | return wnd_initmenupopup(data, xevent); | |
| 590 | #endif | |
| 591 | case WM_SIZE: | |
| 592 | return wnd_size(data, xevent); | |
| 593 | case APPBAR_CALLBACK: | |
| 594 | return gtk_appbar_callback(data, xevent); | |
| 595 | #if 0 | |
| 596 | default: | |
| 15884 | 597 | purple_debug_info("gtkappbar", "gtk_appbar_event_filter %d\n", msg->message); |
| 14286 | 598 | #endif |
| 599 | } | |
| 600 | return GDK_FILTER_CONTINUE; | |
| 601 | } | |
| 602 | ||
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
603 | static void gtk_appbar_do_dock(GtkAppBar *ab, UINT side) { |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
604 | RECT orig, windowRect; |
| 14286 | 605 | |
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
606 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "gtk_appbar_do_dock\n"); |
| 14286 | 607 | |
|
35896
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
608 | if (!ab || !IsWindow(appbar_get_handle(ab))) |
|
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
609 | return; |
| 14286 | 610 | |
| 611 | ab->side = side; | |
|
35896
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
612 | get_window_normal_rc(appbar_get_handle(ab), &(ab->docked_rect)); |
| 14286 | 613 | CopyRect(&orig, &(ab->docked_rect)); |
|
35896
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
614 | get_rect_of_window(appbar_get_handle(ab), &windowRect); |
|
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
615 | gtk_appbar_querypos(ab, appbar_get_handle(ab), windowRect); |
| 14286 | 616 | if(EqualRect(&orig, &(ab->docked_rect)) == 0) |
|
35896
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
617 | MoveWindow(appbar_get_handle(ab), |
| 14286 | 618 | ab->docked_rect.left, |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
619 | ab->docked_rect.top, |
| 14286 | 620 | ab->docked_rect.right - ab->docked_rect.left, |
| 621 | ab->docked_rect.bottom - ab->docked_rect.top, TRUE); | |
|
35896
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
622 | gtk_appbar_setpos(ab, appbar_get_handle(ab)); |
| 14286 | 623 | ab->docked = TRUE; |
| 624 | } | |
| 625 | ||
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
626 | void gtk_appbar_dock(GtkAppBar *ab, UINT side) { |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
627 | HWND hwnd; |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
628 | |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
629 | g_return_if_fail(ab != NULL); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
630 | |
|
35896
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
631 | hwnd = appbar_get_handle(ab); |
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
632 | |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
633 | g_return_if_fail(IsWindow(hwnd)); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
634 | |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
635 | ab->iconized = IsIconic(hwnd); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
636 | |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
637 | if (!ab->docked && !ab->iconized) |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
638 | ShowWindow(hwnd, SW_HIDE); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
639 | gtk_appbar_do_dock(ab, side); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
640 | set_toolbar(hwnd, TRUE); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
641 | if (!ab->iconized) |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
642 | ShowWindow(hwnd, SW_SHOW); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
643 | } |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
644 | |
| 14286 | 645 | void gtk_appbar_add_dock_cb(GtkAppBar *ab, GtkAppBarDockCB dock_cb) { |
| 646 | if(!ab) | |
| 647 | return; | |
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
648 | ab->dock_cbs = g_slist_prepend(ab->dock_cbs, dock_cb); |
| 14286 | 649 | } |
| 650 | ||
| 651 | GtkAppBar *gtk_appbar_add(GtkWidget *win) { | |
| 652 | GtkAppBar *ab; | |
| 653 | ||
| 15884 | 654 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "gtk_appbar_add\n"); |
| 14286 | 655 | |
| 656 | if(!win) | |
| 657 | return NULL; | |
| 658 | ab = g_new0(GtkAppBar, 1); | |
| 659 | ab->win = win; | |
| 660 | ||
| 661 | /* init docking coords */ | |
|
35896
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
662 | get_window_normal_rc(appbar_get_handle(ab), &(ab->docked_rect)); |
| 14286 | 663 | |
| 664 | /* Add main window filter */ | |
|
35896
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
665 | gdk_window_add_filter(gtk_widget_get_window(win), |
| 14286 | 666 | gtk_appbar_event_filter, |
| 667 | ab); | |
| 668 | return ab; | |
| 669 | } | |
| 670 | ||
| 671 | void gtk_appbar_remove(GtkAppBar *ab) { | |
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
672 | HWND hwnd; |
| 15884 | 673 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "gtk_appbar_remove\n"); |
| 14286 | 674 | |
| 675 | if(!ab) | |
| 676 | return; | |
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
677 | |
|
35896
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
678 | hwnd = appbar_get_handle(ab); |
|
bfee243ed8b1
cross-win32: fix gtk3 build
Tomasz Wasilczyk <twasilczyk@pidgin.im>
parents:
31294
diff
changeset
|
679 | gdk_window_remove_filter(gtk_widget_get_window(ab->win), |
| 14286 | 680 | gtk_appbar_event_filter, |
| 681 | ab); | |
| 682 | if(ab->docked) { | |
| 683 | gtk_window_resize(GTK_WINDOW(ab->win), | |
| 684 | ab->docked_rect.right - ab->docked_rect.left, | |
| 685 | ab->undocked_height); | |
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
686 | if (!ab->iconized) |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
687 | ShowWindow(hwnd, SW_HIDE); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
688 | set_toolbar(hwnd, FALSE); |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
689 | if (!ab->iconized) |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
690 | ShowWindow(hwnd, SW_SHOW); |
| 14286 | 691 | } |
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
692 | gtk_appbar_unregister(ab, hwnd); |
| 14286 | 693 | |
|
40079
a37a1e349491
Replace g_[s]list_remove with g_[s]list_delete_link.
Elliott Sales de Andrade <qulogic@pidgin.im>
parents:
35896
diff
changeset
|
694 | g_slist_free(ab->dock_cbs); |
|
19395
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
695 | |
|
13e591244b33
Fix the docked buddy list to consistently not have a taskbar entry thanks to some tips from "imiganai." This took *way* too long because of how arcane dealing with Windows on Windows is (the unnecessary complexity of our gtkappbar implementation doesn't help). Hopefully this doesn't break anything. Fixes #575.
Daniel Atallah <datallah@pidgin.im>
parents:
15884
diff
changeset
|
696 | g_free(ab); |
| 14286 | 697 | } |