Mon, 28 Oct 2013 00:02:17 +0530
Renamed plugin info callback properties to end with "-cb", and their respective symbols.
- Renamed "preferences-frame" to "pref-frame-cb"
- Renamed "preferences-request" to "pref-request-cb"
- Renamed "get-actions" to "actions-cb"
- Renamed "finch-preferences-frame" to "finch-pref-frame-cb"
- Renamed "pidgin-config-frame" to "pidgin-config-frame-cb"
| 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 | #include "debug.h" | |
| 37 | ||
| 38 | #define APPBAR_CALLBACK WM_USER + 1010 | |
| 39 | ||
| 15884 | 40 | typedef HMONITOR WINAPI purple_MonitorFromPoint(POINT, DWORD); |
| 41 | typedef HMONITOR WINAPI purple_MonitorFromWindow(HWND, DWORD); | |
| 42 | typedef BOOL WINAPI purple_GetMonitorInfo(HMONITOR, LPMONITORINFO); | |
| 14286 | 43 | |
|
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
|
44 | 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
|
45 | |
| 14286 | 46 | /* Retrieve the rectangular display area from the specified monitor |
| 47 | * Return TRUE if successful, otherwise FALSE | |
| 48 | */ | |
| 49 | static gboolean | |
| 50 | get_rect_from_monitor(HMODULE hmod, HMONITOR monitor, RECT *rect) { | |
| 15884 | 51 | purple_GetMonitorInfo *the_GetMonitorInfo; |
| 14286 | 52 | MONITORINFO info; |
| 53 | ||
| 15884 | 54 | if (!(the_GetMonitorInfo = (purple_GetMonitorInfo*) |
| 14286 | 55 | GetProcAddress(hmod, "GetMonitorInfoA"))) { |
| 56 | return FALSE; | |
| 57 | } | |
| 58 | ||
| 59 | info.cbSize = sizeof(info); | |
| 60 | if (!the_GetMonitorInfo(monitor, &info)) { | |
| 61 | return FALSE; | |
| 62 | } | |
| 63 | ||
| 64 | CopyRect(rect, &(info.rcMonitor)); | |
| 65 | ||
| 66 | return TRUE; | |
| 67 | } | |
| 68 | ||
| 69 | /** | |
| 70 | * This will only work on Win98+ and Win2K+ | |
| 71 | * Return TRUE if successful, otherwise FALSE | |
| 72 | */ | |
| 73 | static gboolean | |
| 74 | get_rect_at_point_multimonitor(POINT pt, RECT *rect) { | |
| 75 | HMODULE hmod; | |
| 15884 | 76 | purple_MonitorFromPoint *the_MonitorFromPoint; |
| 14286 | 77 | HMONITOR monitor; |
| 78 | ||
| 79 | if (!(hmod = GetModuleHandle("user32"))) { | |
| 80 | return FALSE; | |
| 81 | } | |
| 82 | ||
| 15884 | 83 | if (!(the_MonitorFromPoint = (purple_MonitorFromPoint*) |
| 14286 | 84 | GetProcAddress(hmod, "MonitorFromPoint"))) { |
| 85 | return FALSE; | |
| 86 | } | |
| 87 | ||
| 88 | monitor = | |
| 89 | the_MonitorFromPoint(pt, MONITOR_DEFAULTTOPRIMARY); | |
| 90 | ||
| 91 | return get_rect_from_monitor(hmod, monitor, rect); | |
| 92 | } | |
| 93 | ||
| 94 | /** | |
| 95 | * This will only work on Win98+ and Win2K+ | |
| 96 | * Return TRUE if successful, otherwise FALSE | |
| 97 | */ | |
| 98 | static gboolean | |
| 99 | get_rect_of_window_multimonitor(HWND window, RECT *rect) { | |
| 100 | HMODULE hmod; | |
| 15884 | 101 | purple_MonitorFromWindow *the_MonitorFromWindow; |
| 14286 | 102 | HMONITOR monitor; |
| 103 | ||
| 104 | if (!(hmod = GetModuleHandle("user32"))) { | |
| 105 | return FALSE; | |
| 106 | } | |
| 107 | ||
| 15884 | 108 | if (!(the_MonitorFromWindow = (purple_MonitorFromWindow*) |
| 14286 | 109 | GetProcAddress(hmod, "MonitorFromWindow"))) { |
| 110 | return FALSE; | |
| 111 | } | |
| 112 | ||
| 113 | monitor = | |
| 114 | the_MonitorFromWindow(window, MONITOR_DEFAULTTOPRIMARY); | |
| 115 | ||
| 116 | return get_rect_from_monitor(hmod, monitor, rect); | |
| 117 | } | |
| 118 | ||
| 119 | /* | |
| 120 | * Fallback if cannot get the RECT from the monitor directly | |
| 121 | */ | |
| 122 | static void get_default_workarea(RECT *rect) { | |
| 123 | if (!SystemParametersInfo(SPI_GETWORKAREA, 0, &rect, FALSE)) { | |
| 124 | /* I don't think this will ever happen */ | |
| 125 | rect->left = 0; | |
| 126 | rect->top = 0; | |
| 127 | rect->bottom = GetSystemMetrics(SM_CYSCREEN); | |
| 128 | rect->right = GetSystemMetrics(SM_CXSCREEN); | |
| 129 | } | |
| 130 | } | |
| 131 | ||
| 132 | /* 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
|
133 | static void get_rect_at_point(POINT pt, RECT *rc) { |
|
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
134 | if (!get_rect_at_point_multimonitor(pt, rc)) { |
|
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
135 | get_default_workarea(rc); |
| 14286 | 136 | } |
| 137 | } | |
| 138 | ||
| 139 | /* 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
|
140 | static void get_rect_of_window(HWND window, RECT *rc) { |
|
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
141 | if (!get_rect_of_window_multimonitor(window, rc)) { |
|
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
142 | get_default_workarea(rc); |
| 14286 | 143 | } |
| 144 | } | |
| 145 | ||
| 146 | static void get_window_normal_rc(HWND hwnd, RECT *rc) { | |
| 147 | WINDOWPLACEMENT wplc; | |
| 148 | GetWindowPlacement(hwnd, &wplc); | |
| 149 | CopyRect(rc, &wplc.rcNormalPosition); | |
| 150 | } | |
| 151 | #if 0 | |
| 152 | static void print_rect(RECT *rc) { | |
| 15884 | 153 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "RECT: L:%ld R:%ld T:%ld B:%ld\n", |
| 14286 | 154 | rc->left, rc->right, rc->top, rc->bottom); |
| 155 | } | |
| 156 | #endif | |
| 157 | /** Set the window style to be the "Tool Window" style - small header, no min/max buttons */ | |
| 158 | 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
|
159 | LONG style = GetWindowLong(hwnd, GWL_EXSTYLE); |
| 14286 | 160 | |
| 161 | if(val && !(style & WS_EX_TOOLWINDOW)) | |
| 162 | style |= WS_EX_TOOLWINDOW; | |
| 163 | else if(!val && style & WS_EX_TOOLWINDOW) | |
| 164 | style &= ~WS_EX_TOOLWINDOW; | |
| 165 | else | |
| 166 | return; | |
| 167 | SetWindowLong(hwnd, GWL_EXSTYLE, style); | |
| 168 | SetWindowPos(hwnd, 0, 0, 0, 0, 0, | |
| 169 | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); | |
|
31294
73607ab89c6f
Remove trailing whitespace
Richard Laager <rlaager@pidgin.im>
parents:
25910
diff
changeset
|
170 | |
| 14286 | 171 | /* This really should be the following, but SWP_FRAMECHANGED strangely causes initermittent problems "Show Desktop" done more than once. |
| 172 | * 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
|
173 | * SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); |
| 14286 | 174 | */ |
| 175 | } | |
| 176 | /** Register the window as an appbar */ | |
| 177 | static gboolean gtk_appbar_register(GtkAppBar *ab, HWND hwnd) { | |
| 178 | APPBARDATA abd; | |
| 179 | ||
| 180 | abd.cbSize = sizeof(APPBARDATA); | |
| 181 | abd.hWnd = hwnd; | |
| 182 | abd.uCallbackMessage = APPBAR_CALLBACK; | |
| 183 | ||
| 184 | ab->registered = SHAppBarMessage(ABM_NEW, &abd); | |
| 185 | ||
| 186 | return ab->registered; | |
| 187 | } | |
| 188 | /** Unregister the window as an appbar */ | |
| 189 | static gboolean gtk_appbar_unregister(GtkAppBar *ab, HWND hwnd) { | |
| 190 | APPBARDATA abd; | |
| 191 | ||
| 192 | if(!ab->registered) | |
| 193 | return TRUE; | |
| 194 | ||
| 195 | abd.cbSize = sizeof(APPBARDATA); | |
| 196 | abd.hWnd = hwnd; | |
| 197 | ||
| 198 | SHAppBarMessage(ABM_REMOVE, &abd); /** This always returns TRUE */ | |
| 199 | ||
| 200 | ab->registered = FALSE; | |
| 201 | ||
| 202 | 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
|
203 | ab->undocking = FALSE; |
| 14286 | 204 | ab->docking = FALSE; |
| 205 | ||
| 206 | return TRUE; | |
| 207 | } | |
| 208 | ||
| 209 | static void gtk_appbar_querypos(GtkAppBar *ab, HWND hwnd, RECT rcWorkspace) { | |
| 210 | APPBARDATA abd; | |
| 211 | guint iWidth = 0; | |
| 212 | ||
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
213 | if(!ab->registered) |
|
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
214 | gtk_appbar_register(ab, hwnd); |
| 14286 | 215 | |
| 216 | abd.hWnd = hwnd; | |
| 217 | abd.cbSize = sizeof(APPBARDATA); | |
| 218 | abd.uEdge = ab->side; | |
| 219 | ||
| 220 | iWidth = ab->docked_rect.right - ab->docked_rect.left; | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
221 | |
| 14286 | 222 | abd.rc.top = rcWorkspace.top; |
| 223 | abd.rc.bottom = rcWorkspace.bottom; | |
| 224 | switch (abd.uEdge) | |
| 225 | { | |
| 226 | case ABE_LEFT: | |
| 227 | abd.rc.left = rcWorkspace.left; | |
| 228 | abd.rc.right = rcWorkspace.left + iWidth; | |
| 229 | break; | |
| 230 | ||
| 231 | case ABE_RIGHT: | |
| 232 | abd.rc.right = rcWorkspace.right; | |
| 233 | abd.rc.left = rcWorkspace.right - iWidth; | |
| 234 | break; | |
| 235 | } | |
| 236 | ||
| 237 | /* Ask the system for the screen space */ | |
| 238 | SHAppBarMessage(ABM_QUERYPOS, &abd); | |
| 239 | ||
| 240 | switch (abd.uEdge) | |
| 241 | { | |
| 242 | case ABE_LEFT: | |
| 243 | abd.rc.right = abd.rc.left + iWidth; | |
| 244 | break; | |
| 245 | ||
| 246 | case ABE_RIGHT: | |
| 247 | abd.rc.left = abd.rc.right - iWidth; | |
| 248 | break; | |
| 249 | } | |
| 250 | ||
| 251 | CopyRect(&(ab->docked_rect), &abd.rc); | |
| 252 | } | |
| 253 | /* Actually set the size and screen location of the appbar */ | |
| 254 | static void gtk_appbar_setpos(GtkAppBar *ab, HWND hwnd) { | |
| 255 | APPBARDATA abd; | |
| 256 | ||
| 257 | if(!ab->registered) | |
| 258 | gtk_appbar_register(ab, hwnd); | |
| 259 | ||
| 260 | abd.hWnd = hwnd; | |
| 261 | abd.cbSize = sizeof(APPBARDATA); | |
| 262 | CopyRect(&abd.rc, &(ab->docked_rect)); | |
| 263 | abd.uEdge = ab->side; | |
| 264 | ||
| 265 | SHAppBarMessage(ABM_SETPOS, &abd); | |
| 266 | } | |
| 267 | /** Let any callbacks know that we have docked or undocked */ | |
| 268 | 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
|
269 | GSList *lst = ab->dock_cbs; |
| 14286 | 270 | |
| 271 | while(lst) { | |
| 272 | GtkAppBarDockCB dock_cb = lst->data; | |
| 273 | dock_cb(val); | |
| 274 | lst = lst->next; | |
| 275 | } | |
| 276 | } | |
| 277 | ||
| 278 | static GdkFilterReturn wnd_moving(GtkAppBar *ab, GdkXEvent *xevent) { | |
| 279 | MSG *msg = (MSG*)xevent; | |
| 280 | POINT cp; | |
| 281 | RECT *rc = (RECT*)msg->lParam; | |
| 282 | RECT monRect; | |
| 283 | int side = -1; | |
| 284 | long dockAreaWidth = 0; | |
| 285 | ||
| 15884 | 286 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "wnd_moving\n"); |
| 14286 | 287 | |
| 288 | GetCursorPos(&cp); | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
289 | get_rect_at_point(cp, &monRect); |
| 14286 | 290 | |
| 291 | dockAreaWidth = (monRect.right - monRect.left) / 10; | |
| 292 | /* Which part of the screen are we in ? */ | |
| 293 | if (cp.x > (monRect.right - dockAreaWidth)) { | |
| 294 | side = ABE_RIGHT; | |
| 295 | } else if (cp.x < (monRect.left + dockAreaWidth)) { | |
| 296 | side = ABE_LEFT; | |
| 297 | } | |
| 298 | ||
| 299 | if(!ab->docked) { | |
| 300 | if( (side == ABE_RIGHT || side == ABE_LEFT) ) { | |
| 301 | if( !ab->docking ) { | |
| 302 | ab->side = side; | |
| 303 | GetWindowRect(msg->hwnd, &(ab->docked_rect)); | |
| 304 | gtk_appbar_querypos(ab, msg->hwnd, monRect); | |
| 305 | ||
| 306 | /* save pre-docking height */ | |
| 307 | ab->undocked_height = rc->bottom - rc->top; | |
| 308 | ab->docking = TRUE; | |
| 309 | } | |
| 310 | } | |
| 311 | else | |
| 312 | ab->docking = FALSE; | |
| 313 | } | |
| 314 | else if(side < 0) { | |
| 315 | 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
|
316 | ab->undocking = TRUE; |
| 14286 | 317 | rc->bottom = rc->top + ab->undocked_height; |
| 318 | } | |
| 319 | ||
| 320 | return GDK_FILTER_CONTINUE; | |
| 321 | } | |
| 322 | ||
| 323 | static GdkFilterReturn wnd_sizing(GtkAppBar *ab, GdkXEvent *xevent) { | |
| 324 | MSG *msg = (MSG*)xevent; | |
| 325 | ||
| 15884 | 326 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "wnd_sizing\n"); |
| 14286 | 327 | if(ab->docked) { |
| 328 | RECT *rc = (RECT*)msg->lParam; | |
| 329 | if(ab->side == ABE_LEFT && msg->wParam == WMSZ_RIGHT) { | |
| 330 | ab->docked_rect.right = rc->right; | |
| 331 | gtk_appbar_setpos(ab, msg->hwnd); | |
| 332 | } | |
| 333 | else if(ab->side == ABE_RIGHT && msg->wParam == WMSZ_LEFT) { | |
| 334 | ab->docked_rect.left = rc->left; | |
| 335 | gtk_appbar_setpos(ab, msg->hwnd); | |
| 336 | } | |
| 337 | return GDK_FILTER_REMOVE; | |
| 338 | } | |
| 339 | return GDK_FILTER_CONTINUE; | |
| 340 | } | |
| 341 | /** Notify the system that the appbar has been activated */ | |
| 342 | static GdkFilterReturn wnd_activate(GtkAppBar *ab, GdkXEvent *xevent) { | |
| 343 | if (ab->registered) { | |
| 344 | APPBARDATA abd; | |
| 345 | MSG *msg = (MSG*)xevent; | |
| 15884 | 346 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "wnd_activate\n"); |
| 14286 | 347 | |
| 348 | abd.hWnd = msg->hwnd; | |
| 349 | abd.cbSize = sizeof(APPBARDATA); | |
| 350 | ||
| 351 | SHAppBarMessage(ABM_ACTIVATE, &abd); | |
| 352 | } | |
| 353 | return GDK_FILTER_CONTINUE; | |
| 354 | } | |
|
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
|
355 | |
|
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
|
356 | 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
|
357 | 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
|
358 | |
|
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
|
359 | 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
|
360 | purple_debug_info("gtkappbar", "hidden\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
|
361 | gtk_appbar_unregister(ab, GDK_WINDOW_HWND(ab->win->window)); |
|
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 | 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
|
363 | 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
|
364 | } 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
|
365 | 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
|
366 | 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
|
367 | 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
|
368 | 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
|
369 | } |
|
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 | |
|
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 | } |
|
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 | |
| 14286 | 373 | /** Notify the system that the appbar's position has changed */ |
| 374 | static GdkFilterReturn wnd_poschanged(GtkAppBar *ab, GdkXEvent *xevent) { | |
| 375 | if (ab->registered) { | |
| 376 | APPBARDATA abd; | |
| 377 | 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
|
378 | |
|
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
|
379 | purple_debug(PURPLE_DEBUG_MISC, "gtkappbar", "wnd_poschanged\n"); |
| 14286 | 380 | |
| 381 | abd.hWnd = msg->hwnd; | |
| 382 | abd.cbSize = sizeof(APPBARDATA); | |
| 383 | ||
| 384 | 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
|
385 | |
| 14286 | 386 | } |
| 387 | return GDK_FILTER_CONTINUE; | |
| 388 | } | |
| 389 | /** The window is about to change */ | |
| 390 | static GdkFilterReturn wnd_poschanging(GtkAppBar *ab, GdkXEvent *xevent) { | |
| 391 | MSG *msg = (MSG*)xevent; | |
| 392 | WINDOWPOS *wpos = (WINDOWPOS*)msg->lParam; | |
| 393 | ||
|
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
|
394 | purple_debug(PURPLE_DEBUG_MISC, "gtkappbar", "wnd_poschanging\n"); |
| 14286 | 395 | |
| 396 | if(ab->docked || ab->docking) { | |
| 397 | wpos->x = ab->docked_rect.left; | |
| 398 | wpos->y = ab->docked_rect.top; | |
| 399 | wpos->cx = ab->docked_rect.right - ab->docked_rect.left; | |
| 400 | wpos->cy = ab->docked_rect.bottom - ab->docked_rect.top; | |
| 401 | if(IsIconic(msg->hwnd)) | |
| 402 | set_toolbar(msg->hwnd, FALSE); | |
| 403 | /*return GDK_FILTER_REMOVE;*/ | |
| 404 | } | |
|
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
|
405 | |
|
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
|
406 | 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
|
407 | 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
|
408 | 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
|
409 | 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
|
410 | 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
|
411 | } |
|
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 | |
| 14286 | 413 | return GDK_FILTER_CONTINUE; |
| 414 | } | |
| 415 | ||
| 416 | static GdkFilterReturn wnd_exitsizemove(GtkAppBar *ab, GdkXEvent *xevent) { | |
| 417 | MSG *msg = (MSG*)xevent; | |
| 418 | ||
| 15884 | 419 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "wnd_exitsizemove\n"); |
| 14286 | 420 | 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
|
421 | 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
|
422 | 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
|
423 | 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
|
424 | 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
|
425 | 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
|
426 | 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
|
427 | 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
|
428 | } 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
|
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, 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
|
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, 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
|
433 | ab->undocking = FALSE; |
| 14286 | 434 | } |
| 435 | ||
| 436 | return GDK_FILTER_CONTINUE; | |
| 437 | } | |
| 438 | ||
| 439 | 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
|
440 | MSG *msg = (MSG*)xevent; |
| 14286 | 441 | |
|
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
|
442 | 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
|
443 | 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
|
444 | 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
|
445 | } 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
|
446 | 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
|
447 | } |
|
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 | return GDK_FILTER_CONTINUE; |
| 14286 | 449 | } |
|
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
|
450 | |
| 14286 | 451 | /** The window's size has changed */ |
| 452 | static GdkFilterReturn wnd_size(GtkAppBar *ab, GdkXEvent *xevent) { | |
| 453 | MSG *msg = (MSG*)xevent; | |
| 454 | ||
| 15884 | 455 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "wnd_size\n"); |
| 14286 | 456 | |
| 457 | if(msg->wParam == SIZE_MINIMIZED) { | |
| 15884 | 458 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "Minimize\n"); |
| 14286 | 459 | if(ab->docked) { |
| 460 | gtk_appbar_unregister(ab, GDK_WINDOW_HWND(ab->win->window)); | |
| 461 | ab->docked = TRUE; | |
| 462 | } | |
| 463 | } | |
| 464 | else if(msg->wParam == SIZE_RESTORED) { | |
| 15884 | 465 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "Restore\n"); |
| 14286 | 466 | 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
|
467 | gtk_appbar_do_dock(ab, ab->side); |
| 14286 | 468 | } |
| 469 | } | |
| 470 | return GDK_FILTER_CONTINUE; | |
| 471 | } | |
| 472 | ||
| 473 | static GdkFilterReturn wnd_nchittest(GtkAppBar *ab, GdkXEvent *xevent) { | |
| 474 | MSG *msg = (MSG*)xevent; | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
475 | |
| 14286 | 476 | if(ab->docked) { |
| 477 | UINT ret = DefWindowProc(msg->hwnd, msg->message, msg->wParam, msg->lParam); | |
| 478 | ||
| 479 | switch(ret) { | |
| 480 | case HTBOTTOM: | |
| 481 | case HTBOTTOMLEFT: | |
| 482 | case HTBOTTOMRIGHT: | |
| 483 | case HTTOP: | |
| 484 | case HTTOPLEFT: | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
485 | case HTTOPRIGHT: |
| 14286 | 486 | return GDK_FILTER_REMOVE; |
| 487 | case HTLEFT: | |
| 488 | if(ab->side == ABE_LEFT) | |
| 489 | return GDK_FILTER_REMOVE; | |
| 490 | break; | |
| 491 | case HTRIGHT: | |
| 492 | if(ab->side == ABE_RIGHT) | |
| 493 | return GDK_FILTER_REMOVE; | |
| 494 | break; | |
| 495 | } | |
| 496 | } | |
| 497 | return GDK_FILTER_CONTINUE; | |
| 498 | } | |
| 499 | ||
| 500 | #if 0 | |
| 501 | static GdkFilterReturn wnd_initmenupopup(GtkAppBar *ab, GdkXEvent *xevent) { | |
| 502 | MSG *msg = (MSG*)xevent; | |
| 503 | ||
| 504 | if(ab->docked && HIWORD(msg->lParam)) { | |
| 505 | HMENU sysmenu = GetSystemMenu(msg->hwnd, FALSE); | |
| 15884 | 506 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "wnd_initpopupmenu: docked: %d ismenu: %d\n", ab->docked, IsMenu(sysmenu)); |
| 14286 | 507 | if(EnableMenuItem(sysmenu, SC_MAXIMIZE, MF_BYCOMMAND|MF_GRAYED)<0) |
| 15884 | 508 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "SC_MAXIMIZE Menu item does not exist\n"); |
| 14286 | 509 | if(EnableMenuItem(sysmenu, SC_MOVE, MF_BYCOMMAND|MF_GRAYED)<0) |
| 15884 | 510 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "SC_MOVE Menu item does not exist\n"); |
| 14286 | 511 | return GDK_FILTER_CONTINUE; |
| 512 | } | |
| 513 | else | |
| 514 | GetSystemMenu(msg->hwnd, TRUE); | |
| 515 | return GDK_FILTER_CONTINUE; | |
| 516 | } | |
| 517 | #endif | |
| 518 | ||
| 519 | static GdkFilterReturn gtk_appbar_callback(GtkAppBar *ab, GdkXEvent *xevent) { | |
| 520 | MSG *msg = (MSG*)xevent; | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
521 | RECT orig, windowRect; |
| 14286 | 522 | |
| 523 | switch (msg->wParam) { | |
| 524 | case ABN_STATECHANGE: | |
| 15884 | 525 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "gtk_appbar_callback: ABN_STATECHANGE\n"); |
| 14286 | 526 | break; |
| 527 | ||
| 528 | 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
|
529 | purple_debug(PURPLE_DEBUG_MISC, "gtkappbar", "gtk_appbar_callback: ABN_FULLSCREENAPP: %d\n", (BOOL)msg->lParam); |
| 14286 | 530 | if (!ab->iconized && ab->docked) { |
| 531 | if ((BOOL)msg->lParam) { | |
| 532 | SetWindowPos(msg->hwnd, HWND_BOTTOM, 0, 0, 0, 0, | |
| 533 | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); | |
| 534 | } else { | |
| 535 | SetWindowPos(msg->hwnd, HWND_NOTOPMOST, 0, 0, 0, 0, | |
| 536 | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_FRAMECHANGED); | |
| 537 | } | |
| 538 | } | |
| 539 | ||
| 540 | break; | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
541 | case ABN_POSCHANGED: |
| 15884 | 542 | 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
|
543 | CopyRect(&orig, &(ab->docked_rect)); |
|
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
544 | get_rect_of_window(msg->hwnd, &windowRect); |
|
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
545 | gtk_appbar_querypos(ab, msg->hwnd, windowRect); |
| 14286 | 546 | if (EqualRect(&orig, &(ab->docked_rect)) == 0) { |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
547 | MoveWindow(msg->hwnd, ab->docked_rect.left, ab->docked_rect.top, |
| 14286 | 548 | ab->docked_rect.right - ab->docked_rect.left, |
| 549 | ab->docked_rect.bottom - ab->docked_rect.top, TRUE); | |
| 550 | } | |
| 551 | gtk_appbar_setpos(ab, msg->hwnd); | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
552 | break; |
| 14286 | 553 | #if 0 |
| 554 | default: | |
| 15884 | 555 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "gtk_appbar_callback: %d\n", msg->wParam); |
| 14286 | 556 | #endif |
| 557 | } | |
| 558 | return GDK_FILTER_CONTINUE; | |
| 559 | } | |
| 560 | ||
| 561 | static GdkFilterReturn gtk_appbar_event_filter(GdkXEvent *xevent, GdkEvent *event, gpointer data) { | |
| 562 | MSG *msg = (MSG*)xevent; | |
| 563 | ||
| 564 | /*printf("MSG: %s\n", message_to_string (msg->message));*/ | |
| 565 | switch(msg->message) { | |
| 566 | case WM_EXITSIZEMOVE: | |
| 567 | return wnd_exitsizemove(data, xevent); | |
| 568 | case WM_WINDOWPOSCHANGING: | |
| 569 | return wnd_poschanging(data, xevent); | |
| 570 | case WM_WINDOWPOSCHANGED: | |
| 571 | return wnd_poschanged(data, xevent); | |
| 572 | case WM_ACTIVATE: | |
| 573 | return wnd_activate(data, xevent); | |
| 574 | case WM_SIZING: | |
| 575 | return wnd_sizing(data, xevent); | |
| 576 | case WM_MOVING: | |
| 577 | return wnd_moving(data, xevent); | |
| 578 | case WM_SHOWWINDOW: | |
| 579 | return wnd_showwindow(data, xevent); | |
| 580 | case WM_NCHITTEST: | |
| 581 | return wnd_nchittest(data, xevent); | |
| 582 | #if 0 | |
| 583 | case WM_INITMENUPOPUP: | |
| 584 | return wnd_initmenupopup(data, xevent); | |
| 585 | #endif | |
| 586 | case WM_SIZE: | |
| 587 | return wnd_size(data, xevent); | |
| 588 | case APPBAR_CALLBACK: | |
| 589 | return gtk_appbar_callback(data, xevent); | |
| 590 | #if 0 | |
| 591 | default: | |
| 15884 | 592 | purple_debug_info("gtkappbar", "gtk_appbar_event_filter %d\n", msg->message); |
| 14286 | 593 | #endif |
| 594 | } | |
| 595 | return GDK_FILTER_CONTINUE; | |
| 596 | } | |
| 597 | ||
|
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
|
598 | static void gtk_appbar_do_dock(GtkAppBar *ab, UINT side) { |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
599 | RECT orig, windowRect; |
| 14286 | 600 | |
|
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
|
601 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "gtk_appbar_do_dock\n"); |
| 14286 | 602 | |
| 603 | if(!ab || !IsWindow(GDK_WINDOW_HWND(ab->win->window))) | |
| 604 | return; | |
| 605 | ||
| 606 | ab->side = side; | |
| 607 | get_window_normal_rc(GDK_WINDOW_HWND(ab->win->window), &(ab->docked_rect)); | |
| 608 | CopyRect(&orig, &(ab->docked_rect)); | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
609 | get_rect_of_window(GDK_WINDOW_HWND(ab->win->window), &windowRect); |
|
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
610 | gtk_appbar_querypos(ab, GDK_WINDOW_HWND(ab->win->window), windowRect); |
| 14286 | 611 | if(EqualRect(&orig, &(ab->docked_rect)) == 0) |
| 612 | MoveWindow(GDK_WINDOW_HWND(ab->win->window), | |
| 613 | ab->docked_rect.left, | |
|
15697
78ddac185d80
winpidgin warning fixes
Daniel Atallah <datallah@pidgin.im>
parents:
15435
diff
changeset
|
614 | ab->docked_rect.top, |
| 14286 | 615 | ab->docked_rect.right - ab->docked_rect.left, |
| 616 | ab->docked_rect.bottom - ab->docked_rect.top, TRUE); | |
| 617 | gtk_appbar_setpos(ab, GDK_WINDOW_HWND(ab->win->window)); | |
| 618 | ab->docked = TRUE; | |
| 619 | } | |
| 620 | ||
|
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
|
621 | 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
|
622 | 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
|
623 | |
|
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
|
624 | 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
|
625 | |
|
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 | hwnd = GDK_WINDOW_HWND(ab->win->window); |
|
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 | |
|
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 | 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
|
629 | |
|
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 | 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
|
631 | |
|
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 | 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
|
633 | 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
|
634 | 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
|
635 | 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
|
636 | 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
|
637 | 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
|
638 | } |
|
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 | |
| 14286 | 640 | void gtk_appbar_add_dock_cb(GtkAppBar *ab, GtkAppBarDockCB dock_cb) { |
| 641 | if(!ab) | |
| 642 | 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
|
643 | ab->dock_cbs = g_slist_prepend(ab->dock_cbs, dock_cb); |
| 14286 | 644 | } |
| 645 | ||
| 646 | GtkAppBar *gtk_appbar_add(GtkWidget *win) { | |
| 647 | GtkAppBar *ab; | |
| 648 | ||
| 15884 | 649 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "gtk_appbar_add\n"); |
| 14286 | 650 | |
| 651 | if(!win) | |
| 652 | return NULL; | |
| 653 | ab = g_new0(GtkAppBar, 1); | |
| 654 | ab->win = win; | |
| 655 | ||
| 656 | /* init docking coords */ | |
| 657 | get_window_normal_rc(GDK_WINDOW_HWND(win->window), &(ab->docked_rect)); | |
| 658 | ||
| 659 | /* Add main window filter */ | |
| 660 | gdk_window_add_filter(win->window, | |
| 661 | gtk_appbar_event_filter, | |
| 662 | ab); | |
| 663 | return ab; | |
| 664 | } | |
| 665 | ||
| 666 | 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
|
667 | HWND hwnd; |
| 15884 | 668 | purple_debug(PURPLE_DEBUG_INFO, "gtkappbar", "gtk_appbar_remove\n"); |
| 14286 | 669 | |
| 670 | if(!ab) | |
| 671 | 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
|
672 | |
|
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
|
673 | hwnd = GDK_WINDOW_HWND(ab->win->window); |
| 14286 | 674 | gdk_window_remove_filter(ab->win->window, |
| 675 | gtk_appbar_event_filter, | |
| 676 | ab); | |
| 677 | if(ab->docked) { | |
| 678 | gtk_window_resize(GTK_WINDOW(ab->win), | |
| 679 | ab->docked_rect.right - ab->docked_rect.left, | |
| 680 | 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
|
681 | 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
|
682 | 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
|
683 | 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
|
684 | 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
|
685 | ShowWindow(hwnd, SW_SHOW); |
| 14286 | 686 | } |
|
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
|
687 | gtk_appbar_unregister(ab, hwnd); |
| 14286 | 688 | |
|
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
|
689 | while (ab->dock_cbs) |
|
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 | ab->dock_cbs = g_slist_remove(ab->dock_cbs, ab->dock_cbs->data); |
|
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
|
691 | |
|
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 | g_free(ab); |
| 14286 | 693 | } |